Skip to content

API: Add Calendar Day Frequency ("CD") #22274

Closed
@mroeschke

Description

@mroeschke

This is a proposal to replace #20633.

offsets.Day ('D') is documented to represent calendar day; however, Day arithmetic and usage of the 'D' offset alias (e.g. df.resample('D'), timedelta_range(..., freq='D'), etc.) currently respects absolute time (i.e. Day acts like Timedelta(days=1)). This usage is ingrained pretty deeply in a lot of methods and operations and is fairly difficult to walk back to respect the notion of calendar day as stated in the docs.

Instead, I propose to keep Day as is (a timedelta-like frequency like Hour ('H')) and add a new frequency CalendarDay, 'CD'. It would act very similarly to DateOffset(day=1) but act like a frequency. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignBlockerBlocking issue or pull request for an upcoming releaseFrequencyDateOffsets

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions