Skip to content

Commit ac34074

Browse files
committed
remove special casing in _wrap_aggregated_output
1 parent 0f61c2d commit ac34074

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/core/groupby/generic.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1645,10 +1645,7 @@ def _wrap_aggregated_output(
16451645
indexed_output = {key.position: val for key, val in output.items()}
16461646

16471647
agg_axis = self._obj_with_exclusions._get_axis(1 - self.axis)
1648-
if isinstance(agg_axis, MultiIndex):
1649-
columns = Index([key.label for key in output], names=agg_axis.names)
1650-
else:
1651-
columns = Index([key.label for key in output], name=agg_axis.name)
1648+
columns = Index([key.label for key in output], names=agg_axis.names)
16521649

16531650
result = self.obj._constructor(indexed_output)
16541651
result.columns = columns

0 commit comments

Comments
 (0)