Skip to content

Commit 961ec6a

Browse files
committed
More generalization
1 parent c452276 commit 961ec6a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

xarray/core/groupby.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,9 +1049,7 @@ def quantile(
10491049
The American Statistician, 50(4), pp. 361-365, 1996
10501050
"""
10511051
if dim is None:
1052-
self._raise_if_not_single_group()
1053-
(grouper,) = self.groupers
1054-
dim = self.group1d.dims
1052+
dim = self._group_dim
10551053

10561054
# Dataset.quantile does this, do it for flox to ensure same output.
10571055
q = np.asarray(q, dtype=np.float64)
@@ -1267,9 +1265,7 @@ def _combine(self, applied, shortcut=False):
12671265
combined = self._concat_shortcut(applied, dim, positions)
12681266
else:
12691267
combined = concat(applied, dim)
1270-
self._raise_if_not_single_group()
1271-
(grouper,) = self.groupers
1272-
combined = _maybe_reorder(combined, dim, positions, N=grouper.group.size)
1268+
combined = _maybe_reorder(combined, dim, positions, N=self.group1d.size)
12731269

12741270
if isinstance(combined, type(self._obj)):
12751271
# only restore dimension order for arrays
@@ -1358,7 +1354,6 @@ class DatasetGroupByBase(GroupBy["Dataset"], DatasetGroupbyArithmetic):
13581354
@property
13591355
def dims(self) -> Frozen[Hashable, int]:
13601356
if self._dims is None:
1361-
self._raise_if_not_single_group()
13621357
index = self.encoded.group_indices[0]
13631358
self._dims = self._obj.isel({self._group_dim: index}).dims
13641359

0 commit comments

Comments
 (0)