Skip to content

Commit 2e93037

Browse files
committed
Fix performance regression in transform
1 parent 31f93e5 commit 2e93037

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def _set_result_index_ordered(self, result):
491491

492492
# shortcut of we have an already ordered grouper
493493
if not self.grouper.is_monotonic:
494-
index = Index(np.concatenate([ indices[v] for v in self.grouper.result_index if v in indices]))
494+
index = Index(np.concatenate([ indices.get(v, []) for v in self.grouper.result_index]))
495495
result.index = index
496496
result = result.sort_index()
497497

0 commit comments

Comments
 (0)