Skip to content

Commit 90b9c8a

Browse files
committed
Fixed name sorting issue
1 parent 32d1b6b commit 90b9c8a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/core/groupby/generic.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,12 @@ def _insert_inaxis_grouper_inplace(self, result):
14551455

14561456
def _wrap_aggregated_output(self, output, names=None):
14571457
agg_axis = 0 if self.axis == 1 else 1
1458-
agg_labels = self._obj_with_exclusions._get_axis(agg_axis)
14591458

1460-
output_keys = self._decide_output_index(output, agg_labels)
1459+
if isinstance(output, dict):
1460+
output_keys = output.keys()
1461+
else:
1462+
agg_labels = self._obj_with_exclusions._get_axis(agg_axis)
1463+
output_keys = self._decide_output_index(output, agg_labels)
14611464

14621465
if not self.as_index:
14631466
result = DataFrame(output, columns=output_keys)

0 commit comments

Comments
 (0)