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

Method group_as_index

xarray/groupers.py:227–234  ·  view source on GitHub ↗

Caches the group DataArray as a pandas Index.

(self)

Source from the content-addressed store, hash-verified

225
226 @property
227 def group_as_index(self) -> pd.Index:
228 """Caches the group DataArray as a pandas Index."""
229 if self._group_as_index is None:
230 if self.group.ndim == 1:
231 self._group_as_index = self.group.to_index()
232 else:
233 self._group_as_index = pd.Index(np.array(self.group).ravel())
234 return self._group_as_index
235
236 def reset(self) -> Self:
237 return type(self)()

Callers

nothing calls this directly

Calls 1

to_indexMethod · 0.45

Tested by

no test coverage detected