Skip to content

Commit 8bc61db

Browse files
committed
pandas-dev#36757 fix for speed issue
1 parent 257ad4e commit 8bc61db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/groupby/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ def reset_identity(values):
11911191
# when the ax has duplicates
11921192
# so we resort to this
11931193
# GH 14776, 30667
1194-
if ax.has_duplicates:
1194+
if ax.has_duplicates and not result.axes[self.axis].equals(ax):
11951195
indexer, _ = result.index.get_indexer_non_unique(ax.values)
11961196
indexer = algorithms.unique1d(indexer)
11971197
result = result.take(indexer, axis=self.axis)

0 commit comments

Comments
 (0)