-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[BUG]: Fix regression when adding timeldeta_range to timestamp #36582
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
Conversation
� Conflicts: � doc/source/whatsnew/v1.1.3.rst
This is half of the fix i suggested in #35897, but we need both halves. |
@jbrockmendel Why is the freq incorrect? We get |
Because of rounding error
If |
so are there cases where a frequency should not be inferred by if so, maybe revert #32377 and open a issue for discussion on how inference should work? The docs begin 'Return a fixed frequency TimedeltaIndex...' so having None as in 1.0.5 maybe not desirable, but can perhaps also discuss the api breaking implications. for instance should pd.timedelta_range('0s','1s', periods=31) perhaps raise with a message along the lines 'ValueError: cannot infer a fixed frequency from start, end and periods due to rounding errors` or is a fractional freq a feasible option? did #32377 actually fix/address any reported bugs/enhancement requests? It appears it was a pre-cursor to a PR that was closed without merging #31195.
is it worth splitting #35897 or is the inferred freq for |
is the solution to only infer freq if
|
thanks @phofl good patch. @simonjayhawkins can certainly discuss on the issue but agree inferring None here is right. |
ok sure (pls push it if you can). |
…)" This reverts commit dee2c55.
…as-dev#36582)" (pandas-dev#36616) This reverts commit dee2c55.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff