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

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

Comments

Projects
None yet
2 participants
Contributor

chris-b1 commented Oct 22, 2015

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')
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

Contributor

chris-b1 commented Oct 22, 2015

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

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 added this to the 0.18.0 milestone Dec 1, 2015

@chris-b1 chris-b1 added a commit to chris-b1/pandas that referenced this issue Dec 6, 2015

@chris-b1 chris-b1 BUG/API: QuarterBegin n=0 #11406 08245c8
Contributor

jreback commented Dec 10, 2015

closed by #11777

jreback closed this Dec 10, 2015

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