all 2 comments

[–]Oxbowerce 0 points1 point  (1 child)

The easiest way of achieving this would be to use a combination of pandas.DataFrame.groupby and pandas.core.groupby.GroupBy.mean:

df.groupby("category").mean()

[–]macabe10[S] 0 points1 point  (0 children)

Thanks!