MCPcopy Create free account
hub / github.com/dask/dask / func

Function func

dask/array/tests/test_array_core.py:1585–1586  ·  view source on GitHub ↗
(block, block_id=None, c=0)

Source from the content-addressed store, hash-verified

1583 d = from_array(x, chunks=(2,))
1584
1585 def func(block, block_id=None, c=0):
1586 return np.ones_like(block) * sum(block_id) + c
1587
1588 out = d.map_blocks(func, dtype="i8")
1589 expected = np.array([0, 0, 1, 1, 2, 2, 3, 3, 4, 4], dtype="i8")

Callers 3

test_coerceFunction · 0.70
test_normalize_chunksFunction · 0.70

Calls 8

sumFunction · 0.50
keysMethod · 0.45
dtypeMethod · 0.45
onesMethod · 0.45
sumMethod · 0.45
arangeMethod · 0.45
zerosMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected