File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ Performance improvements
285
285
- Performance improvement accessing :attr: `arrays.IntegerArrays.dtype ` & :attr: `arrays.FloatingArray.dtype ` (:issue: `52998 `)
286
286
- Performance improvement in :class: `Series ` reductions (:issue: `52341 `)
287
287
- Performance improvement in :func: `concat ` when ``axis=1 `` and objects have different indexes (:issue: `52541 `)
288
+ - Performance improvement in :meth: `.DataFrameGroupBy.groups ` (:issue: `53088 `)
288
289
- Performance improvement in :meth: `DataFrame.loc ` when selecting rows and columns (:issue: `53014 `)
289
290
- Performance improvement in :meth: `Series.corr ` and :meth: `Series.cov ` for extension dtypes (:issue: `52502 `)
290
291
- Performance improvement in :meth: `Series.to_numpy ` when dtype is a numpy float dtype and ``na_value `` is ``np.nan `` (:issue: `52430 `)
Original file line number Diff line number Diff line change @@ -697,8 +697,14 @@ def groups(self) -> dict[Hashable, np.ndarray]:
697
697
if len (self .groupings ) == 1 :
698
698
return self .groupings [0 ].groups
699
699
else :
700
- to_groupby = zip (* (ping .grouping_vector for ping in self .groupings ))
701
- index = Index (to_groupby )
700
+ to_groupby = []
701
+ for ping in self .groupings :
702
+ gv = ping .grouping_vector
703
+ if not isinstance (gv , BaseGrouper ):
704
+ to_groupby .append (gv )
705
+ else :
706
+ to_groupby .append (gv .groupings [0 ].grouping_vector )
707
+ index = MultiIndex .from_arrays (to_groupby )
702
708
return self .axis .groupby (index )
703
709
704
710
@final
You can’t perform that action at this time.
0 commit comments