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 95eb153 commit 0914808Copy full SHA for 0914808
pandas/core/groupby/groupby.py
@@ -1013,11 +1013,12 @@ def reset_identity(values):
1013
1014
if not not_indexed_same:
1015
result = concat(values, axis=self.axis)
1016
- ax = (
1017
- self.filter(lambda x: True).axes[self.axis]
1018
- if self.dropna
1019
- else self._selected_obj._get_axis(self.axis)
1020
- )
+
+ ax = self._selected_obj._get_axis(self.axis)
+ if self.dropna:
+ labels = self.grouper.group_info[0]
+ mask = labels != -1
1021
+ ax = ax[mask]
1022
1023
# this is a very unfortunate situation
1024
# we can't use reindex to restore the original order
0 commit comments