I'm trying to add column header for a mean column. Refer to below Mean for each column in df :
A B C
0 5 3 8
1 5 3 9
2 8 4 9
df.mean()
A 6.000000
B 3.333333
C 8.666667
dtype: float64
What I want to achieve is below output:
Mean
A 6.000000
B 3.333333
C 8.666667
dtype: float64
So far I've tried df.columns['Mean'] but does not work. I think it's something to do with the dtype float64 instead of standard dataframe object. Can anyone give a hint.