USD / INR汇率的SARIMA预测图的TypeError

时间:2020-05-25 12:13:33

标签: python-3.x timestamp time-series typeerror

我在USD-INR数据上实现SARIMA并应用了模型,同时绘制了来自结果对象的预测,结果显示了一个错误,提示我说TypeError:int()参数必须是字符串,类似字节的对象或数字,而不是“时间戳记”,我尝试将其作为字符串传递,但无济于事。请找到以下代码以获取任何解决方案。

代码

pred = results.get_prediction(start=pd.to_datetime('2019-09-25'), dynamic=False, axis = 0)
pred_ci = pred.conf_int()
ax = y['2017':].plot(label='observed')
pred.predicted_mean.plot(ax=ax, label='One-step ahead Forecast', alpha=.7, figsize=(14, 4))
ax.fill_between(pred_ci.index,
                pred_ci.iloc[:, 0],
                pred_ci.iloc[:, 1], color='k', alpha=.2)
ax.set_xlabel('Date')
ax.set_ylabel('Close')
plt.legend()
plt.show()

#error
TypeError                                 Traceback (most recent call last)
<ipython-input-44-9408203f49a0> in <module>()
----> 1 pred = results.get_prediction(start=pd.to_datetime('2019-09-25'), dynamic=False, axis = 0)
      2 pred_ci = pred.conf_int()
      3 ax = y['2017':].plot(label='observed')
      4 pred.predicted_mean.plot(ax=ax, label='One-step ahead Forecast', alpha=.7, figsize=(14, 4))
      5 ax.fill_between(pred_ci.index,
TypeError: int() argument must be a string, a bytes-like object or a number, not 'Timestamp'

0 个答案:

没有答案