Skip to content

Commit 5f39b51

Browse files
authored
REF: remove unnecessary consolidate in GroupBy.describe (#41243)
1 parent 030d63b commit 5f39b51

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pandas/core/groupby/groupby.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1800,9 +1800,7 @@ def describe(self, **kwargs):
18001800
result = self.apply(lambda x: x.describe(**kwargs))
18011801
if self.axis == 1:
18021802
return result.T
1803-
# FIXME: not being consolidated breaks
1804-
# test_describe_with_duplicate_output_column_names
1805-
return result._consolidate().unstack()
1803+
return result.unstack()
18061804

18071805
@final
18081806
def resample(self, rule, *args, **kwargs):

pandas/tests/groupby/test_function.py

+1
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ def test_describe_with_duplicate_output_column_names(as_index):
10771077
"c": [10, 20, 30, 40, 50, 60],
10781078
},
10791079
columns=["a", "b", "b"],
1080+
copy=False,
10801081
)
10811082

10821083
expected = (

0 commit comments

Comments
 (0)