MCPcopy
hub / github.com/pydata/xarray / get_duck_array

Method get_duck_array

xarray/core/indexing.py:1967–1975  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1965 return np.asarray(array.values, dtype=dtype)
1966
1967 def get_duck_array(self) -> np.ndarray | PandasExtensionArray:
1968 # We return a PandasExtensionArray wrapper type that satisfies
1969 # duck array protocols.
1970 # `NumpyExtensionArray` is excluded
1971 if is_allowed_extension_array(self.array):
1972 from xarray.core.extension_array import PandasExtensionArray
1973
1974 return PandasExtensionArray(self.array.array)
1975 return np.asarray(self)
1976
1977 @property
1978 def shape(self) -> _Shape:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected