diff --git a/xarray/core/groupby.py b/xarray/core/groupby.py index 2a75c35c255..1d2f62cfff7 100644 --- a/xarray/core/groupby.py +++ b/xarray/core/groupby.py @@ -587,9 +587,7 @@ def groups(self) -> dict[GroupKey, GroupIndex]: """ # provided to mimic pandas.groupby if self._groups is None: - self._raise_if_not_single_group() - (grouper,) = self.groupers - self._groups = dict(zip(grouper.unique_coord.values, self._group_indices)) + self._groups = dict(zip(self._unique_coord.data, self._group_indices)) return self._groups def __getitem__(self, key: GroupKey) -> T_Xarray: