Skip to content

API: dt64 resolution for PeriodIndex.to_timestamp #56164

Open
@jbrockmendel

Description

@jbrockmendel
idx = PeriodIndex(["2011-01", "NaT", "2011-02"], freq="2M", name="idx")

res = idx.to_timestamp()

ATM we always give datetime64[ns] resolution in to_timestamp, but we could reasonably choose lower-resolutions for lower-resolution PeriodDtypes. This could avoid OutOfBoundsDatetime in some cases for e.g. pd.PeriodIndex(["May 3000"], freq="M")

Metadata

Metadata

Assignees

No one assigned

    Labels

    API - ConsistencyInternal Consistency of API/BehaviorIndexRelated to the Index class or subclassesPeriodPeriod data typeTimestamppd.Timestamp and associated methods

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions