-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
QuarterBegin wrong date #14254
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
Comments
see comments here
|
I don't see how that explains why |
This comment is suggestive. That git blame is just from a reorganization, not the actual commit :/ |
actually this issue was raised before, see: #13644 |
cc @chris-b1 |
and better doc pointer here (though this is just for months, quarter is the same) |
The default anchor month for qtr = pd.tseries.offsets.QuarterBegin(startingMonth=1)
pd.Timestamp.today() - qtr
Out[13]: Timestamp('2016-07-01 16:06:23.581744') |
@chris-b1 thanks for that. I would think that should be the default behavior. I remember reading in a related issue that some countries financials start in March. But if January is the anchor month that the majority of users expect / think of when they hear quarterly, it should be that. The |
There is an open issue for that, #8435, and I agree |
actually let's put in a deprecation for 0.20 as in #8435 though not sure exactly how to do that unless we always warn if no parameter is passed (but that might be annoying) |
@jreback don't think there is a way avoid being annoying and that's probably the point so people actually notice it and update their code. They can always filter the warning or turn off warnings altogether. |
@postelrich the issue is back-compat. We can either warn everyone (whom does not specify a default), or NOT have back-compat, with potential for breaking code. Not everyone (well maybe most, dont' read the documentation), or take the time to test their code for changes. This can be a very subtle change that still works, but in a subtle way. We really really try to avoid these types of changes. sure people can filter warnings, but they don't |
@jreback yea I see your point about backwards compatibility, not that I know much about the versioning for pandas, but this isn't even at a 1.0 yet. I would vote for changing it to what the expected behavior is to avoid future confusion. At a minimum, the docs should be updated for the next release to clarify the default behavior and the optional arguments available to modify it. |
@postelrich pandas goes out of its way to avoid breaking back-compat (at sometimes lots work). 1.0 has nothing to do with this. |
@jreback another potential issue but maybe should be a separate ticket. pd.Timestamp('2016-01-01') - pd.tseries.offsets.QuarterBegin(startingMonth=1)
If you're already at the quarter begin, shouldn't it just return itself? |
Those are the defined semantics - |
Would expect this to point to one of (1, 4, 7, 10)...
The text was updated successfully, but these errors were encountered: