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
xref https://github.com/pandas-dev/pandas/pull/15568/files#r104304074
In [7]: pd.DatetimeIndex(['2016-10-17 12:00:00.0015']).round('ns') Out[7]: DatetimeIndex(['2016-10-17 12:00:00.001499904'], dtype='datetime64[ns]', freq=None)
This is the unfortunate problem of converting from int64->float64->int64. I am not sure there is an easy way to fix this. We could:
The text was updated successfully, but these errors were encountered:
so actually this is 'easy'; I think for values of round < 1us (e.g. ns values), you can simply do something like this.
simulating .round('10ns')
.round('10ns')
In [48]: i Out[48]: DatetimeIndex(['2016-10-17 12:00:00.001501031'], dtype='datetime64[ns]', freq=None) In [49]: DatetimeIndex(1000000 * (i.asi8 // 1000000) + 10*(np.round((i.asi8 % 1000000)/float(10))).astype('i8')) Out[49]: DatetimeIndex(['2016-10-17 12:00:00.001501030'], dtype='datetime64[ns]', freq=None)
IOW, we avoid the float precision problem by only working with the last 6 digits, then adding back the original portion.
cc @mroeschke
Sorry, something went wrong.
BUG: Timestamp.round precision error for ns (pandas-dev#15578)
6256833
af95baa
Raise warning for invalid frequencies
fdee922
c4f6960
closes pandas-dev#15578 Author: Matt Roeschke <[email protected]> Closes pandas-dev#15588 from mroeschke/fix_15578 and squashes the following commits: af95baa [Matt Roeschke] BUG: Timestamp.round precision error for ns (pandas-dev#15578)
Successfully merging a pull request may close this issue.
xref https://github.com/pandas-dev/pandas/pull/15568/files#r104304074
This is the unfortunate problem of converting from int64->float64->int64. I am not sure there is an easy way to fix this. We could:
The text was updated successfully, but these errors were encountered: