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

Function _take_dask_array_from_numpy

dask/array/routines.py:2016–2022  ·  view source on GitHub ↗
(a, indices, axis)

Source from the content-addressed store, hash-verified

2014
2015
2016def _take_dask_array_from_numpy(a, indices, axis):
2017 assert isinstance(a, np.ndarray)
2018 assert isinstance(indices, Array)
2019
2020 return indices.map_blocks(
2021 lambda block: np.take(a, block, axis), chunks=indices.chunks, dtype=a.dtype
2022 )
2023
2024
2025@derived_from(np)

Callers 1

takeFunction · 0.85

Calls 2

takeMethod · 0.80
map_blocksMethod · 0.45

Tested by

no test coverage detected