Skip to content

Commit

Permalink
Merge pull request #2412 from josef-pkt/x13_py3
Browse files Browse the repository at this point in the history
MAINT: tsa.x13 python 3 compat
  • Loading branch information
josef-pkt committed Jun 24, 2015
2 parents 4b55fa4 + 4de3027 commit d0a6fcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions statsmodels/tsa/x13.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _convert_out_to_series(x, dates, name):
Convert x to a DataFrame where x is a string in the format given by
x-13arima-seats output.
"""
from StringIO import StringIO
from statsmodels.compat import StringIO
from pandas import read_table
out = read_table(StringIO(x), skiprows=2, header=None)
return out.set_index(dates).rename(columns={1 : name})[name]
Expand Down Expand Up @@ -215,7 +215,7 @@ def create_spec(self, **kwargs):

def set_options(self, **kwargs):
options = ""
for key, value in kwargs.iteritems():
for key, value in iteritems(kwargs):
options += "{0}={1}\n".format(key, value)
self.__dict__.update({key : value})
self.options = options
Expand Down Expand Up @@ -431,7 +431,7 @@ def x13_arima_analysis(endog, maxorder=(2, 1), maxdiff=(2, 1), diff=None,
ftempin = tempfile.NamedTemporaryFile(delete=False, suffix='.spc')
ftempout = tempfile.NamedTemporaryFile(delete=False)
try:
ftempin.write(spec)
ftempin.write(spec.encode('utf8'))
ftempin.close()
ftempout.close()
# call x12 arima
Expand Down

0 comments on commit d0a6fcb

Please sign in to comment.