Skip to content

DEPR: PeriodDtype.freq #61897

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Motivated by #47227.

First (and by a wide margin smallest) of several PRs to deprecate using freq to refer to a Period's resolution. If we go down this route, the other PRs will incrementally do the same for freq in the Period constructor, then freq as a Period attribute, then the same for PeriodArray/Index. We shouldn't merge this until we're agreed to do this across the board.

This uses "unit" as the replacement, as that is also what we use for Timestamp/Timedelta. But while it has roughly the same semantic meaning, Period.unit does return a different type from Timestamp.unit, which might be a reason to use a third term? Also "unit" is overloaded in to_datetime/to_timedelta. So while "unit" is the best idea I've had, I'll understand if people want to bikeshed.

cc @mroeschke @jorisvandenbossche

@jbrockmendel
Copy link
Member Author

Could do "offset" for the BaseOffset object and "unit" for the string?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant