pandas中出现AttributeError错误怎么办

这篇文章主要为大家展示了“pandas中出现AttributeError错误怎么办”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“pandas中出现AttributeError错误怎么办”这篇文章吧。

AttributeError: module ‘pandas’ has no attribute ‘rolling_mean’

moving_avg = pd.rolling_mean(ts_log,12)

上面代码报错:AttributeError: module ‘pandas’ has no attribute ‘rolling_mean’

解决方法:

moving_avg = ts_log.rolling(12).mean()

以上是“pandas中出现AttributeError错误怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!