@@ -1048,10 +1048,7 @@ def quantile(
1048
1048
"Sample quantiles in statistical packages,"
1049
1049
The American Statistician, 50(4), pp. 361-365, 1996
1050
1050
"""
1051
- if dim is None :
1052
- self ._raise_if_not_single_group ()
1053
- (grouper ,) = self .groupers
1054
- dim = self .group1d .dims
1051
+ dim = dim or self ._group_dim
1055
1052
1056
1053
# Dataset.quantile does this, do it for flox to ensure same output.
1057
1054
q = np .asarray (q , dtype = np .float64 )
@@ -1267,9 +1264,7 @@ def _combine(self, applied, shortcut=False):
1267
1264
combined = self ._concat_shortcut (applied , dim , positions )
1268
1265
else :
1269
1266
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 )
1267
+ combined = _maybe_reorder (combined , dim , positions , N = self .group1d .size )
1273
1268
1274
1269
if isinstance (combined , type (self ._obj )):
1275
1270
# only restore dimension order for arrays
@@ -1358,7 +1353,6 @@ class DatasetGroupByBase(GroupBy["Dataset"], DatasetGroupbyArithmetic):
1358
1353
@property
1359
1354
def dims (self ) -> Frozen [Hashable , int ]:
1360
1355
if self ._dims is None :
1361
- self ._raise_if_not_single_group ()
1362
1356
index = self .encoded .group_indices [0 ]
1363
1357
self ._dims = self ._obj .isel ({self ._group_dim : index }).dims
1364
1358
0 commit comments