I have this kind of Dataframe:
Tag X
2 45.5
5 56.4
4 34.2
2 89.5
4 78.1
5 44.1
6 35.5
I would like to calculate the Standard Deviation for each object in the column 'Tag' using the .group.by function if possible. I tried this code, but it doesn't work:
Df['Std X'] = Df[['X']].groupby(Df['Tag']).std(axis=1)
Thanks for the help