Skip to content

Commit 571fad9

Browse files
jbrockmendelJulianWgs
authored andcommitted
REF: remove unnecessary consolidate in GroupBy.describe (pandas-dev#41243)
1 parent 8008321 commit 571fad9

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
@@ -1805,9 +1805,7 @@ def describe(self, **kwargs):
18051805
result = self.apply(lambda x: x.describe(**kwargs))
18061806
if self.axis == 1:
18071807
return result.T
1808-
# FIXME: not being consolidated breaks
1809-
# test_describe_with_duplicate_output_column_names
1810-
return result._consolidate().unstack()
1808+
return result.unstack()
18111809

18121810
@final
18131811
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)