We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31f93e5 commit 2e93037Copy full SHA for 2e93037
pandas/core/groupby.py
@@ -491,7 +491,7 @@ def _set_result_index_ordered(self, result):
491
492
# shortcut of we have an already ordered grouper
493
if not self.grouper.is_monotonic:
494
- index = Index(np.concatenate([ indices[v] for v in self.grouper.result_index if v in indices]))
+ index = Index(np.concatenate([ indices.get(v, []) for v in self.grouper.result_index]))
495
result.index = index
496
result = result.sort_index()
497
0 commit comments