Skip to content

API: resolution for date_range, to_datetime, timedelta_range, to_timedelta #49060

Open
@jbrockmendel

Description

@jbrockmendel

In 2.0 we'll support non-nanosecond datetime64 and timedelta64. ATM date_range, timedelta_range, to_datetime, and to_timedelta still are nano-only. This issue is about how to support non-nano in these functions.

Two main options: inference or a keyword. A keyword would be something like pd.date_range(start, end, periods=10, reso="ms"), and the default would be "ns". This is the simplest thing to implement, but adds more API surface.

inference for date_range would look at start and stop to determine the correct resolution. This could get messy if e.g. start and stop have different resos. ATM im thinking this isn't worth it.

inference for to_datetime (really in array_to_datetime) is more compelling in part bc I expect to_datetime to be called by library code for e.g. io.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignNon-Nanodatetime64/timedelta64 with non-nanosecond resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions