Search code examples
pythondataframejupyter-notebooktime-seriesvalueerror

ValueError: DataFrame constructor not properly called for sarima


this is the code and above mentioned is the error i am getting how to solve it and sarima_forecast is a series.

Sarima_df = pd.DataFrame(sarima_forecast[0], columns = df.columns)


Solution

  • Try using to_frame:

    Sarima_df = sarima_forecast.to_frame(df.columns[0])