Reputation: 6290
I have a Pandas dataframe with several columns and several rows. I would like to group by a column called "A". I can do this by df.groupby('A')
. Now I would like to take the means of column called "C" of each group which I can do with df.groupby('A').C.mean()
. Finally, I would like to take the mean of the means of each group for column C.
How can I achieve this (the final result should just be one integer, i.e. the mean of the means of each group)?
Upvotes: 0
Views: 73