A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/50806 below:

groupby.describe on a frame with duplicate column names · Issue #50806 · pandas-dev/pandas · GitHub

xref #46944

pd.set_option("display.max_columns", None)

df = DataFrame([[0, 1, 2, 3]])
df.columns = [0, 1, 2, 0]
gb = df.groupby(df[1])
print(gb.describe(percentiles=[]).to_string())
#       0                                                           2                        
#   count mean std  min  50%  max count mean std  min  50%  max count mean std  min  50%  max
# 1                                                                                          
# 1   1.0  0.0 NaN  0.0  0.0  0.0   1.0  3.0 NaN  3.0  3.0  3.0   1.0  2.0 NaN  2.0  2.0  2.0

With duplicate column names, describe only outputs the values for the first column. There should be two columns named 0 here. This issue occurs for any operation where the groupby code is using _selected_obj within the _group_selection_context.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4