【发布时间】:2020-01-29 16:28:36
【问题描述】:
mte_exp_wighted_avg = pd.ewma(mte, halflife=12)
plt.plot(mte)
plt.plot(mte_exp_wighted_avg, color='red')
plt.xticks(fontsize = 25)
plt.yticks(fontsize = 25)
plt.xlabel('Years', fontsize = 25)
plt.ylabel('CO2 Emission', fontsize = 25)
plt.title('CO2 emission by coal power generation', fontsize = 25)
plt.show()
代码如上,pandas升级了
错误如下所示
【问题讨论】:
-
这里是错误信息------------------------- -------------------------------------- AttributeError Traceback (最近一次调用最后一次)
in () ----> 1 mte_exp_wighted_avg = pd.ewma(mte, halflife=12) 2 plt.plot(mte) 3 plt.plot(mte_exp_wighted_avg, color='red') 4 plt.xticks(fontsize = 25) 5 plt.yticks(fontsize = 25) AttributeError: module 'pandas' has no attribute 'ewma' -
嘿,欢迎来到 SO(StackOverflow)!您可能想查看this。您也可以编辑您的帖子。因此,您可能希望将您的评论移至问题中。
标签: python pandas time-series