BUG: Unable to infer negative freq #11018

Merged
merged 1 commit into from Sep 7, 2015

Conversation

Projects
None yet
2 participants
Member

sinhrks commented Sep 7, 2015

Fixed 2 issues:

  • date_range can't handle negative calendar-based freq (like A, Q and M).
import pandas as pd

# OK
pd.date_range('2011-01-01', freq='-1D', periods=3)
# DatetimeIndex(['2011-01-01', '2010-12-31', '2010-12-30'], dtype='datetime64[ns]', freq='-1D')

# NG
pd.date_range('2011-01-01', freq='-1M', periods=3)
# DatetimeIndex([], dtype='datetime64[ns]', freq='-1M')
  • Unable to infer negative freq.
pd.DatetimeIndex(['2011-01-05', '2011-01-03', '2011-01-01'], freq='infer')
# DatetimeIndex(['2011-01-05', '2011-01-03', '2011-01-01'], dtype='datetime64[ns]', freq=None)

pd.TimedeltaIndex(['-1 days', '-3 days', '-5 days'], freq='infer')
# TimedeltaIndex(['-1 days', '-3 days', '-5 days'], dtype='timedelta64[ns]', freq=None)

sinhrks added this to the 0.17.0 milestone Sep 7, 2015

@jreback jreback added a commit that referenced this pull request Sep 7, 2015

@jreback jreback Merge pull request #11018 from sinhrks/negative_freq
BUG: Unable to infer negative freq
0b858f0

@jreback jreback merged commit 0b858f0 into pandas-dev:master Sep 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Contributor

jreback commented Sep 7, 2015

thanks @sinhrks

sinhrks deleted the sinhrks:negative_freq branch Sep 7, 2015

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