Skip to content

BUG: repr on DTI with high precision is wrong #19030

Closed
@jreback

Description

@jreback

SO the value is correct

In [2]: pd.DatetimeIndex(['2017-01-01 23:59:59.999999999'])
Out[2]: DatetimeIndex(['2017-01-01'], dtype='datetime64[ns]', freq=None)

In [3]: pd.DatetimeIndex(['2017-01-01 23:59:59.999999999']).values
Out[3]: array(['2017-01-01T23:59:59.999999999'], dtype='datetime64[ns]')

and lower precision is ok

In [4]: pd.DatetimeIndex(['2017-01-01 23:59:59.999999'])
Out[4]: DatetimeIndex(['2017-01-01 23:59:59.999999'], dtype='datetime64[ns]', freq=None)

but the ns is causing issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeOutput-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions