I'm trying to forecast with SARIMA model but it keeps showing
'numpy.ndarray' object has no attribute 'plot'
Does anyone know how to solve it?
ax = monthly_mean['2016':].plot(label='observed')
predictions.predicted_mean.plot(ax=ax, label='One-step ahead Forecast', alpha=.7)
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('CO2 Levels')
plt.legend()
plt.show()
Mad Physicist
115k29 gold badges201 silver badges291 bronze badges
lang-py
predictions.predicted_mean
is an array. Array can be passed as an argument toplt.plot
. It does not have aplot
method. What made you think that was possible?