0

I have this dataframe:

Name Measure 1 Measure 2 Measure 3
Name1 0.5 0.4 0.8
Name1 0.3 0.6 0.9
Name1 0.6 0.5 0.1
Name1 0.4 0.2 0.6
Name2 0.5 0.8 0.3
Name2 0.1 0.6 0.4
Name2 0.2 0.9 0.8
Name2 0.9 0.1 0.6
Name3 0.8 0.2 0.9
Name3 0.7 0.8 0.2
Name3 0.3 0.5 0.5
Name3 0.7 0.6 0.7

And I would like to extract the mean of each column and get this:

  • Name1 = [Mean Measure1, Mean Measure2, Mean Measure3]
  • Name2 = [Mean Measure1, Mean Measure2, Mean Measure3]
  • Name3 = [Mean Measure1, Mean Measure2, Mean Measure3]

What would be the best way to obtain this?

Thanks.

JLL
  • 3
  • 1
  • Hi, I think you should first look for *a* way yourself, share your attempts & where it fails (if it does), and only then look for "the best way". –  Jan 07 '22 at 13:01
  • 1
    Looks like you want a simple `df.groupby('Name').mean()` – mozway Jan 07 '22 at 13:02

0 Answers0