Caches the group DataArray as a pandas Index.
(self)
| 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)() |