我在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'