I have time series data of electricity consumption. I want to calculate rolling standard deviation of 1 hour intervals with window size of 10 i.e. I want to take values from 8-9AM for last 10 days and compute std() for that window, then compute it for 9-10 AM window across last 10 days and so on.

I tried below 2 approaches but these are not working:

df.groupby([df.index.date, pd.Grouper(freq='1h')])['value'].std()


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.