Skip to content

Commit

Permalink
Merge pull request #1872 from TomAugspurger/infer_freq_pandas_break
Browse files Browse the repository at this point in the history
BUG: fix _infer_freq for pandas .14+ compat closes #1822
  • Loading branch information
josef-pkt committed Aug 6, 2014
2 parents 8709f00 + 14e293d commit 2e806fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions statsmodels/tsa/base/datetools.py
Expand Up @@ -281,8 +281,9 @@ def _add_datetimes(dates):
return reduce(lambda x, y: y+x, dates)

def _infer_freq(dates):
if hasattr(dates, "freqstr"):
return dates.freqstr
maybe_freqstr = getattr(dates, 'freqstr', None)
if maybe_freqstr is not None:
return maybe_freqstr
try:
from pandas.tseries.api import infer_freq
freq = infer_freq(dates)
Expand Down

0 comments on commit 2e806fc

Please sign in to comment.