DataFrame with integer names not handled in ARIMA #1038

jseabold opened this Issue Aug 12, 2013 · 3 comments


None yet

2 participants

from datetime import datetime
import pandas as pd
import statsmodels.api as sm

vals = [96.2, 98.3, 99.1, 95.5, 94.0, 87.1, 87.9, 86.7402777504474]

dr = pd.date_range(, periods=len(vals), freq='AS')
ts = pd.TimeSeries(vals, index=dr)
df = pd.DataFrame(ts)
model = sm.tsa.ARIMA(df,(2,0,2)).fit()

File "scripts/", line 85, in 
model = ARIMA(df,(2,0,2), freq='AS').fit()
File "/Library/Python/2.7/site-packages/statsmodels-0.5.0-py2.7-macosx-10.8-intel.egg/statsmodels/tsa/", line 806, in fit
File "/Library/Python/2.7/site-packages/statsmodels-0.5.0-py2.7-macosx-10.8-intel.egg/statsmodels/tsa/", line 312, in _make_arma_names
ar_lag_names = util.make_lag_names([data.ynames], k_ar, 0)
File "/Library/Python/2.7/site-packages/statsmodels-0.5.0-py2.7-macosx-10.8-intel.egg/statsmodels/tsa/vector_ar/", line 63, in make_lag_names
TypeError: cannot concatenate 'str' and 'numpy.int64' objects

Reported in this comment by @debovis b9cc594#commitcomment-3840566

Not sure if this is a bug yet. I suspect it may be, but if you just pass in the TimeSeries there's a lag order error. Should be able to get initial estimates for a 2,2 model with 8 observations.


The lag order 'bug' is due to the fact that the lag-order selection in AR for the start params is 6 and there's only 8 observations. Really not sure how much of a real use-case this is to warrant a fix, but I guess I'll throw in another check.


Can you check that #1039 fixes your problems?

@jseabold jseabold closed this in 3c9f89f Aug 14, 2013
debovis commented Aug 14, 2013

Everything looks good, thanks for the quick response and turnover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment