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

Method _get_axis_num

xarray/core/common.py:244–251  ·  view source on GitHub ↗
(self: Any, dim: Hashable)

Source from the content-addressed store, hash-verified

242 return self._get_axis_num(dim)
243
244 def _get_axis_num(self: Any, dim: Hashable) -> int:
245 _raise_if_any_duplicate_dimensions(self.dims)
246 try:
247 return self.dims.index(dim)
248 except ValueError as err:
249 raise ValueError(
250 f"{dim!r} not found in array dimensions {self.dims!r}"
251 ) from err
252
253 @property
254 def sizes(self: Any) -> Mapping[Hashable, int]:

Callers 2

get_axis_numMethod · 0.95
coarsen_reshapeMethod · 0.45

Calls 2

indexMethod · 0.45

Tested by

no test coverage detected