We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think this is rounding prematurely, though not entirely sure. Could also just be loss of precision when converting from a float -> int64.
In [12]: pd.to_datetime(1434743731.8770001,unit='s') Out[12]: Timestamp('2015-06-19 19:55:31.877000') In [13]: pd.to_datetime(1434743731.8770001,unit='s').value Out[13]: 1434743731877000000 In [14]: (pd.Timestamp('2015-06-19 19:55:15.877000')+pd.Timedelta('1us')).value Out[14]: 1434743715877001000
The text was updated successfully, but these errors were encountered:
Copying from #19680
It happens in this function:
In [126]: pd._libs.tslibs.timedeltas.cast_from_unit(1.5e-6, 's') Out[126]: 2000
because we round at 6 decimals:
pandas/pandas/_libs/tslibs/timedeltas.pyx
Lines 210 to 212 in 405ed25
Line 234 in 405ed25
Not fully sure why we choose 6 decimals to be allowed, and not 9 in case of 's' (and 6 in case of 'ms', 3 for 'us', ..)
Sorry, something went wrong.
Isn't this the same as #12690?
Indeed, will close the other in favor of this one. Thanks for noticing!
Successfully merging a pull request may close this issue.
I think this is rounding prematurely, though not entirely sure. Could also just be loss of precision when converting from a float -> int64.
The text was updated successfully, but these errors were encountered: