how to get a dictionary with mean for every type of attribute

So in case you want all means for a specific column, say ‘b’, you can just use groupby and aggregate by mean. For example:

mean_df = df2.groupby("b").mean()


   a  c
2  4  4
5  4  6

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top