Reputation: 151
I am trying to forecast multiple time series that exist in a single dataframe. However I am struggling with the loop. In my head, I want to go through each column (each product), forecast using autoarima, save the results in a new dataframe and move onto the next.
The dataframe looks as follows
Date| Product 1 | Product 2 | Product 3....
I have about 1000 product lines.
What I have got now is something along the following lines:
series=pd.read_excel('C:Users\Isra\Desktop\Forecast.xlsx')
series['Date']=series['Date'].astype('datetime64[ns]')
series=series.set_index('Date')
Products=series.columns.tolist()
for x in enumerate(series):
prod1=series.take([x],axis=1)
#and then forecasting
Upvotes: 1
Views: 311
Reputation: 31
With the AutoArima of github.com/statsforecast you can train multiple series. You just need your data to be in the following formar |Product Nr|Date|Vale
Upvotes: 1