Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Unable to infer negative freq #11018

Merged
merged 1 commit into from
Sep 7, 2015
Merged

Conversation

sinhrks
Copy link
Member

@sinhrks 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 sinhrks added Bug Frequency DateOffsets labels Sep 7, 2015
@sinhrks sinhrks added this to the 0.17.0 milestone Sep 7, 2015
jreback added a commit that referenced this pull request Sep 7, 2015
BUG: Unable to infer negative freq
@jreback jreback merged commit 0b858f0 into pandas-dev:master Sep 7, 2015
@jreback
Copy link
Contributor

jreback commented Sep 7, 2015

thanks @sinhrks

@sinhrks sinhrks deleted the negative_freq branch September 7, 2015 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants