Skip to content

BUG: Timedelta repr does not show nanoseconds #9309

Closed
@sinhrks

Description

@sinhrks

Not sure this is intended, but Timestamp and Timedelta displays nanoseconds information inconsistently.

  • Timestamp shows nanoseconds when it isn't 0
dt = pd.Timestamp(datetime.datetime.now())
h = pd.Timedelta(hours=1)

dt
#2015-01-21 00:01:05.260660
dt + offsets.Nano()
#2015-01-21 00:01:05.260660001
  • But Timedelta doesn't.
pd.Timedelta(nanoseconds=1)
#0 days 00:00:00.000000
pd.Timedelta(nanoseconds=1).nanoseconds
#1

I think Timestamp behavior is prefferable to avoid any misunderstanding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions