如何解决AttributeError:模块'pandas'没有属性'ewma'?

时间:2019-06-14 07:25:58

标签: python-3.x pandas

我遇到的熊猫属性错误:0.24.2

expwighted_avg = pd.ewma(ts_log, halflife=12)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-67-cbd5d537822b> in <module>()
----> 1 expwighted_avg = pd.ewma(ts_log, halflife=12)

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

1 个答案:

答案 0 :(得分:0)

对我来说,现在可以正常工作并且代码可以成功运行

    expwighted_avg = ts_log.ewm(halflife=12).mean()