Skip to content

API: Timestamp/Timedelta resolution in __repr__ #49059

@jbrockmendel

Description

@jbrockmendel
Member

Discussed on today's call, in 2.0 Timestamp and Timedelta will support non-nanosecond resolutions, and this should probably be reflected in the repr, something like Timestamp("2016-01-01 10:24:11.012", reso="ms").

ATM it is possible to do eval(repr(ts)) on a Timestamp. If we want to maintain that, we'll need to add a reso keyword (or another name, we discussed "unit" but that conflicts with the existing unit keyword) to the constructors.

If we do add a reso keyword, it may make sense to add it to to_datetime, date_range, to_timedelta, timedelta_range. That would avoid the need to do reso-inference in those functions.

Activity

jreback

jreback commented on Oct 12, 2022

@jreback
Contributor

adding reso to the constructors and repr lgtm

added
TimedeltaTimedelta data type
Non-Nanodatetime64/timedelta64 with non-nanosecond resolution
Timestamppd.Timestamp and associated methods
and removed
Needs TriageIssue that has not been reviewed by a pandas team member
on Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignNon-Nanodatetime64/timedelta64 with non-nanosecond resolutionTimedeltaTimedelta data typeTimestamppd.Timestamp and associated methods

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jreback@jbrockmendel@mroeschke

        Issue actions

          API: Timestamp/Timedelta resolution in __repr__ · Issue #49059 · pandas-dev/pandas