python - How to get the column names of a DataFrame GroupBy object? -


how can column names of groupby object? object not supply columns propertiy. can aggregate object first or extract dataframe get_group()-method either power consuming hack or error prone if there dismissed columns (strings example).

looking @ source code of __getitem__, seems can column names with

g.obj.columns 

where g groupby object. apparently g.obj links dataframe.


Comments