-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Truncated "Y" conversion with to_timedelta #14024
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
So we pass to numpy for this conversion (then pandas converts to the proper units). It doesn't allow floats, so its converted to integer. So should either:
|
Thanks @jreback |
I actually was of the impression we disallowed this, but apparantly, it's in
I personally would remove support for those units (above 'D'), as it is rather garbage that is produced (if people expect that it gives exactly eg the month they want, but not any month is 30 days and 10 hours ...). Not sure how much that would break code (how many people are relying on this behaviour?) |
hmm ok let's deprecate it then? |
Yes, deprecating first is a good idea. |
I think raising on floats for |
ok let's deprecate |
Closing this in favor of #16344 |
When converting a fractional year to a
Timedelta
object the float is truncated:Using a float with the hour unit is OK:
Pandas version:
The text was updated successfully, but these errors were encountered: