79124791

Date: 2024-10-25 08:09:38
Score: 0.5
Natty:
Report link

To achieve what you want, I think you just need to resample the data monthly and apply a rolling window of 2 to calculate the mean and standard deviation. Try with the following code:

rolling_mean = df.resample('M').mean().rolling(window=2).mean()
rolling_std = df.resample('M').mean().rolling(window=2).std()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Kelo