Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: Period, PeriodFoo #54235

Open
jbrockmendel opened this issue Jul 23, 2023 · 0 comments
Open

DEPR: Period, PeriodFoo #54235

jbrockmendel opened this issue Jul 23, 2023 · 0 comments
Labels
Deprecate Functionality to remove in pandas Needs Discussion Requires discussion from core team before further action Period Period data type

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Jul 23, 2023

This was discussed a few dev calls ago, merits an issue.

Now that we support non-nano TImestamp/datetime64, many of the motivating use cases for Period can be handled there. If we further extended this support to the other np.datetime64 units, could we obviate the need for Period altogether?

Upsides (after deprecations are enforced)

Some sticking points come to mind

  • Period units that don't have corresponding np.datetime64 units
    • BDay (xref DEPR: Period[B] #53446 that seems DatetimeIndex[D] with freq="B" should be good enough?)
    • Week-with-anchor
    • Quarter
    • Year-with-anchor
  • Period is stricter than Timestamp/dt64 about not allowing operations between periods with mismatched freqs/units
  • Would we want to support tz-awareness for lower-reso units? Timezones can have minute (maybe even higher in principle?) resolution, which would be very weird to pin to e.g. a dt64[h]. On the flip side, supporting tz for some units but not others might be akward.
  • Period supports integer multiples e.g. freq="2ms" which we don't currently support for dt64 (though numpy does, so it is possible)
  • PeriodIndex has slightly different partial-indexing behavior in get_loc than DatetimeIndex. Someone might be relying on that?
@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member Period Period data type Deprecate Functionality to remove in pandas Needs Discussion Requires discussion from core team before further action and removed Needs Triage Issue that has not been reviewed by a pandas team member Bug labels Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Needs Discussion Requires discussion from core team before further action Period Period data type
Projects
None yet
Development

No branches or pull requests

1 participant