We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f592ad commit a05ff18Copy full SHA for a05ff18
pandas/core/groupby/ops.py
@@ -774,8 +774,8 @@ def result_index_and_ids(self) -> tuple[Index, npt.NDArray[np.intp]]:
774
# Combine unobserved and observed parts
775
names = self.names
776
codes = [ping.codes for ping in self.groupings]
777
- ob_indices = [k for k, e in enumerate(obs) if e]
778
- unob_indices = [k for k, e in enumerate(obs) if not e]
+ ob_indices = [idx for idx, ob in enumerate(obs) if ob]
+ unob_indices = [idx for idx, ob in enumerate(obs) if not ob]
779
ob_index, ob_ids = self._ob_index_and_ids(
780
levels=[levels[idx] for idx in ob_indices],
781
codes=[codes[idx] for idx in ob_indices],
0 commit comments