def groups(self) -> dict[GroupKey, GroupIndex]:
        """
        Mapping from group labels to indices. The indices can be used to index the underlying object.
        """
        # provided to mimic pandas.groupby
        if self._groups is None:
            self._groups = dict(
                zip(
                    self.encoded.unique_coord.data,
                    self.encoded.group_indices,
                    strict=True,
                )
            )
        return self._groups

        Mapping from group labels to indices. The indices can be used to index the underlying object.
        
xarray/core/groupby.py