MCPcopy
hub / github.com/dask/dask / atleast_nd

Function atleast_nd

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

Source from the content-addressed store, hash-verified

4543 # or NUMPY_LICENSE.txt within this directory
4544
4545 def atleast_nd(x, ndim):
4546 x = asanyarray(x)
4547 diff = max(ndim - x.ndim, 0)
4548 if diff == 0:
4549 return x
4550 else:
4551 return x[(None,) * diff + (Ellipsis,)]
4552
4553 def format_index(index):
4554 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…