Jul-13-2019, 08:11 AM
(Jul-13-2019, 07:33 AM)perfringo Wrote: Maybe I don't comprehend the whole picture but there is input-output library of statsmodel - iolib
Quote:Users can also leverage the powerful input/output functions provided by pandas.io. Among other things, pandas (a statsmodels dependency) allows reading and writing to Excel, CSV, and HDF5 (PyTables).
Hi Mr,
first i would like to thank you for you help.
i checked the link that you had sent, and i make some modifications on my code so as it becomes as follow:
import pandas as pd from statsmodels.tsa.base.datetools import dates_from_str import numpy as np from statsmodels.tsa.api import VAR, DynamicVAR import matplotlib.pyplot as plt import statsmodels.api as sm from statsmodels.iolib.table import SimpleTable data_NO_nan_neg=dta[ ['TMIN','TMAX','UMIN', 'UMAX','DD','FF' ,'RR' , 'TD','PS', 'PM'] ] model =sm.tsa.VAR(data_NO_nan_neg) results = model.fit(maxlags=7, method='ols', ic='aic', trend='c', verbose=False) res2=results.summary() results_as_csv=res2.tables[0].as_csv()i re-run the model and i am getting the following error:
Error:results_as_csv=res2.tables[0].as_csv()
AttributeError: 'VARSummary' object has no attribute 'tables'
can you please help me to overpass this error.Thank you a lot Mr.