How to calculate means and std at once in pandas?

Viewed 5988

For example, we have data like :

>>> df
   name  score  times
0   tom    100      1
1   tom     99      2
2   tom    100      3
3  jack     99      1
4  jack     99      2
5  tony    100      1
6  tony    100      2
7  tony    100      3

I want to get a result like

   name       score std
0  jack   99.000000  0
1   tom   99.666667  0.57
2  tony  100.000000  0

Is it possible to get the result at once? Now I have to calculate them seperately and combine the result

3 Answers
Related