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

Method __getitem__

xarray/core/accessor_str.py:293–300  ·  view source on GitHub ↗
(
        self,
        key: int | slice,
    )

Source from the content-addressed store, hash-verified

291 return self._apply(func=len, dtype=int)
292
293 def __getitem__(
294 self,
295 key: int | slice,
296 ) -> T_DataArray:
297 if isinstance(key, slice):
298 return self.slice(start=key.start, stop=key.stop, step=key.step)
299 else:
300 return self.get(key)
301
302 def __add__(self, other: Any) -> T_DataArray:
303 return self.cat(other, sep="")

Callers

nothing calls this directly

Calls 2

sliceMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected