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

Function atleast_nd

dask/array/core.py:4540–4546  ·  view source on GitHub ↗
(x, ndim)

Source from the content-addressed store, hash-verified

4538 # or NUMPY_LICENSE.txt within this directory
4539
4540 def atleast_nd(x, ndim):
4541 x = asanyarray(x)
4542 diff = max(ndim - x.ndim, 0)
4543 if diff == 0:
4544 return x
4545 else:
4546 return x[(None,) * diff + (Ellipsis,)]
4547
4548 def format_index(index):
4549 return "arrays" + "".join(f"[{i}]" for i in index)

Callers 1

blockFunction · 0.85

Calls 2

maxFunction · 0.90
asanyarrayFunction · 0.70

Tested by

no test coverage detected