MCPcopy Index your code
hub / github.com/pydata/xarray / to_0d_array

Function to_0d_array

xarray/core/utils.py:402–407  ·  view source on GitHub ↗

Given a value, wrap it in a 0-D numpy.ndarray.

(value: Any)

Source from the content-addressed store, hash-verified

400
401
402def to_0d_array(value: Any) -> np.ndarray:
403 """Given a value, wrap it in a 0-D numpy.ndarray."""
404 if np.isscalar(value) or (isinstance(value, np.ndarray) and value.ndim == 0):
405 return np.array(value)
406 else:
407 return to_0d_object_array(value)
408
409
410def dict_equiv(

Callers 1

_convert_scalarMethod · 0.90

Calls 1

to_0d_object_arrayFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…