【发布时间】:2019-09-29 13:54:45
【问题描述】:
我正在逐步了解 Analytics Vidhya 的
时间序列预测不久前发布。我正在计算指数移动平均线的步骤
https://www.analyticsvidhya.com/blog/2016/02/time-series-forecasting-codes-python/?
文章链接。
这是vidhya的代码:
xpwighted_avg = pd.ewma(ts_log, halflife=12)
plt.plot(ts_log)
plt.plot(expwighted_avg, color=‘red’)
我的代码:
expwavg = a.ewm(span=12, adjust=True).mean()
plt.plot(a)
plt.plot(expwavg, color='red')
a 是我的数据集。我相信功能已经改变,我正在使用最新的功能。解决此功能的任何帮助都会有所帮助。
错误:列表对象没有属性 ewm 或 ewma
谢谢,
【问题讨论】:
-
a 的类型是什么?
print(type(a))
标签: python python-3.x pandas time-series