Skip to content

DOC: Anchored Offset Starting Quarter and Year defaults to JAN not DEC #17787

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

Open
tdpetrou opened this issue Oct 4, 2017 · 2 comments
Open
Labels

Comments

@tdpetrou
Copy link
Contributor

tdpetrou commented Oct 4, 2017

Code Sample, a copy-pastable example if possible

>>> index = pd.date_range('2012-1-1', '2013-12-31')
>>> np.random.seed(1)
>>> data = np.random.randint(0, 10, len(index))
>>> s = pd.Series(index=index, data=data)

>>> s.resample('Q').sum()
2012-03-31    457
2012-06-30    404
2012-09-30    401
2012-12-31    415
2013-03-31    383
2013-06-30    382
2013-09-30    398
2013-12-31    387
Freq: Q-DEC, dtype: int64

>>> s.resample('Q-DEC').sum() # same as above

>>> s.resample('QS').sum() # defaults to QS-JAN
2012-01-01    457
2012-04-01    404
2012-07-01    401
2012-10-01    415
2013-01-01    383
2013-04-01    382
2013-07-01    398
2013-10-01    387
Freq: QS-JAN, dtype: int64

>>> s.resample('QS-DEC').sum()
2011-12-01    299
2012-03-01    427
2012-06-01    381
2012-09-01    438
2012-12-01    386
2013-03-01    396
2013-06-01    375
2013-09-01    414
2013-12-01    111
Freq: QS-DEC, dtype: int64

Problem description

The docs have

(B)Q(S)-DEC quarterly frequency, year ends in December. Same as ‘Q’

But QS is the same as QS-JAN not December. The same thing for AS.

@tdpetrou tdpetrou changed the title DOCS: Anchored Offset Starting Quarter and Year defaults to JAN not DEC DOC: Anchored Offset Starting Quarter and Year defaults to JAN not DEC Oct 4, 2017
@jreback
Copy link
Contributor

jreback commented Oct 4, 2017

its not if you see this issue: #5307

@jreback jreback added Docs Frequency DateOffsets labels Oct 4, 2017
@tdpetrou
Copy link
Contributor Author

tdpetrou commented Oct 5, 2017

I'm confused. That issue doesn't appear to have anything to do with this. The docs seem clearly wrong. The docs inform the user that QS defaults to QS-DEC. It does not. It defaults to QS-JAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants