We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 918ef26 commit 861baa9Copy full SHA for 861baa9
pandas/core/groupby/generic.py
@@ -1645,8 +1645,8 @@ def _wrap_aggregated_output(
1645
DataFrame
1646
"""
1647
indexed_output = {key.position: val for key, val in output.items()}
1648
- agg_axis = self._obj_with_exclusions._get_axis(1 - self.axis)
1649
- columns = Index([key.label for key in output], name=agg_axis._get_names())
+ columns = Index([key.label for key in output])
+ columns._set_names(self._obj_with_exclusions._get_axis(1 - self.axis).names)
1650
1651
result = self.obj._constructor(indexed_output)
1652
result.columns = columns
0 commit comments