This is how I calculate the mean by the group:
I need to calculate the group mean value of the 'volatility'. The group is 'code_YM'. But the results of mean volatility,'stock_volatility',
are all nan. Could u help me to fix this?
The type of 'volatility' is float. The type of 'code_YM' is string. I dont know why the results are all nan. I hope the result of mean value could be float.