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: QuarterBegin doesn't match other offsets for n=0 #11406

Closed
chris-b1 opened this issue Oct 22, 2015 · 4 comments
Closed

BUG: QuarterBegin doesn't match other offsets for n=0 #11406

chris-b1 opened this issue Oct 22, 2015 · 4 comments
Labels
API Design Datetime Datetime data dtype Frequency DateOffsets
Milestone

Comments

@chris-b1
Copy link
Contributor

xref #8435 (different issue though)
normally the semantic is to roll forward to the next period for n=0

In [15]: pd.Timestamp('2014-3-2') + pd.offsets.MonthBegin(n=0)
Out[15]: Timestamp('2014-04-01 00:00:00')

In [16]: pd.Timestamp('2014-3-2') + pd.offsets.QuarterBegin(n=0)
Out[16]: Timestamp('2014-03-01 00:00:00')

In [17]: #expected: Timestamp('2014-06-01 00:00:00')
@jreback
Copy link
Contributor

jreback commented Oct 22, 2015

I recall this from a discussion within one of the freq issues (though don't remember the substance)
maybe have a look thru some of the issues

@chris-b1
Copy link
Contributor Author

haven't found much yet, but I guess this behavior was explicitly tested -
https://github.com/pydata/pandas/blob/master/pandas/tseries/tests/test_offsets.py#L2921

@jreback
Copy link
Contributor

jreback commented Dec 1, 2015

@chris-b1 yeh at the very least quarters should be consistent. I'd say go with how month/year work. Make a nice big note in what's new / docs w.r.t. this as its an API breaking change.

@jreback jreback added this to the 0.18.0 milestone Dec 1, 2015
chris-b1 added a commit to chris-b1/pandas that referenced this issue Dec 6, 2015
jreback pushed a commit that referenced this issue Dec 10, 2015
@jreback
Copy link
Contributor

jreback commented Dec 10, 2015

closed by #11777

@jreback jreback closed this as completed Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Datetime Datetime data dtype Frequency DateOffsets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants