Mapping from group labels to indices. The indices can be used to index the underlying object.
(self)
| 821 | |
| 822 | @property |
| 823 | def groups(self) -> dict[GroupKey, GroupIndex]: |
| 824 | """ |
| 825 | Mapping from group labels to indices. The indices can be used to index the underlying object. |
| 826 | """ |
| 827 | # provided to mimic pandas.groupby |
| 828 | if self._groups is None: |
| 829 | self._groups = dict( |
| 830 | zip( |
| 831 | self.encoded.unique_coord.data, |
| 832 | tuple(g for g in self.encoded.group_indices if g), |
| 833 | strict=True, |
| 834 | ) |
| 835 | ) |
| 836 | return self._groups |
| 837 | |
| 838 | def __getitem__(self, key: GroupKey) -> T_Xarray: |
| 839 | """ |
no outgoing calls
no test coverage detected