Skip to content

Timestamp .round precision for ns #15578

Closed
@jreback

Description

@jreback

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:

  • ignore (maybe doc it)
  • raise/warn

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeError ReportingIncorrect or improved errors from pandas

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions