Home > Software engineering >  Python df.groupby(level=0).mean() looses columns
Python df.groupby(level=0).mean() looses columns

Time:06-26

So I wrote a program that generates analytical data, it has 60 rows and 37 columns. It concats perfectly, so I have all the tables I need going in order one after one (downwards). No columns or rows are missing.

example of rows

But when I run

df_grouped = df_concat.groupby(level=0).mean()

it returns a table with only 14 columns

CodePudding user response:

It will take mean of only numerical columns I guess this is why you might be loosing columns.

  • Related