其他分享
首页 > 其他分享> > pandas中没有了'rolling_mean' 'rolling_std'

pandas中没有了'rolling_mean' 'rolling_std'

作者:互联网

rolmean = pd.rolling_mean(timeseries, window=12)

rolstd = pd.rolling_std(timeseries, window=12)

会有报错

AttributeError: module 'pandas' has no attribute 'rolling_mean'

AttributeError: module 'pandas' has no attribute 'rolling_std'

 

这是因为pandas版本跟新了,应该改为

rolmean = timeseries.rolling(12).mean()
rolstd = timeseries.rolling(12).std()

 

标签:std,12,timeseries,rolling,pandas,mean
来源: https://www.cnblogs.com/xingnie/p/12248732.html