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

Method get_duck_array

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

Source from the content-addressed store, hash-verified

840 return np.broadcast(*self.key.tuple).shape
841
842 def get_duck_array(self):
843 from xarray.backends.common import BackendArray
844
845 if isinstance(self.array, BackendArray):
846 array = self.array[self.key]
847 else:
848 array = apply_indexer(self.array, self.key)
849 if isinstance(array, ExplicitlyIndexed):
850 array = array.get_duck_array()
851 return _wrap_numpy_scalars(array)
852
853 async def async_get_duck_array(self):
854 from xarray.backends.common import BackendArray

Callers

nothing calls this directly

Calls 3

apply_indexerFunction · 0.90
_wrap_numpy_scalarsFunction · 0.85
get_duck_arrayMethod · 0.45

Tested by

no test coverage detected