0

Note: I did more complex question here, since it seems to complex on one question, I decide to split into smaller one

Here's my dataset

name    AEON Mall Jakarta Garden City   Blok M Plaza      Buaran Plaza  Central Park Mall   Cibubur Junction
date_id                     
20220501                       6569.0          751.0            1719.0             4215.0   1125.0
20220502                       6028.0          569.0            1855.0             4151.0   439.0

Here's my curent code

import pmdarima.arima as pm

model_1 = pm.auto_arima(df['AEON Mall Jakarta Garden City'], 
                        m=7, seasonal=True,
                      start_p=0, start_q=0, max_order=4, test='adf',error_action='ignore',  
                           suppress_warnings=True,
                      stepwise=True, trace=True)

model_2 = pm.auto_arima(df['Blok M Plaza'], 
                        m=7, seasonal=True,
                      start_p=0, start_q=0, max_order=4, test='adf',error_action='ignore',  
                           suppress_warnings=True,
                      stepwise=True, trace=True)

model_3 = pm.auto_arima(df['Buaran Plaza'], 
                        m=7, seasonal=True,
                      start_p=0, start_q=0, max_order=4, test='adf',error_action='ignore',  
                           suppress_warnings=True,
                      stepwise=True, trace=True)
...

Since te actiual dataframe is have 55 columns, the code is prone to mistake, how to do looping in this case

Expected output avaliable here

Nabih Bawazir
  • 6,381
  • 7
  • 37
  • 70
  • 1
    Pls explain what are you trying to do and what is the expected output. Looping in python is usually the last resource... – gtomer Aug 19 '22 at 07:46
  • 1
    You can create a dictionary of models, then loop through columns and add models to the dictionary – Rm4n Aug 19 '22 at 07:54
  • @gtomer Avaliable output is avaliable on links, this is just slice of question – Nabih Bawazir Aug 19 '22 at 08:39

0 Answers0