Skip to content

string-representation for Timestamp does not show nanoseconds if present #5912

Closed
@cancan101

Description

@cancan101

See:

In [27]: str(pd.Timestamp(200))
Out[27]: '1970-01-01 00:00:00'

In [28]: repr(pd.Timestamp(200))
Out[28]: "Timestamp('1970-01-01 00:00:00.000000200', tz=None)"

whereas microseconds work fine:

In [30]: str(pd.Timestamp(2000))
Out[30]: '1970-01-01 00:00:00.000002'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Output-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