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

Function to_0d_object_array

xarray/namedarray/utils.py:98–104  ·  view source on GitHub ↗

Given a value, wrap it in a 0-D numpy.ndarray with dtype=object.

(
    value: object,
)

Source from the content-addressed store, hash-verified

96
97
98def to_0d_object_array(
99 value: object,
100) -> NDArray[np.object_]:
101 """Given a value, wrap it in a 0-D numpy.ndarray with dtype=object."""
102 result = np.empty((), dtype=object)
103 result[()] = value
104 return result
105
106
107def is_dict_like(value: Any) -> TypeGuard[Mapping[Any, Any]]:

Callers 2

from_arrayFunction · 0.90
to_0d_arrayFunction · 0.90

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…