-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
base: main
Are you sure you want to change the base?
DEPR: PeriodDtype.freq #61897
Conversation
Could do "offset" for the BaseOffset object and "unit" for the string? |
I think this is a good reason to use a different term. I think "offset" or "interval" would be good terms |
I'd like to avoid "interval" since that already has a meaning in pandas. offset im happy with. @jorisvandenbossche are you on board with this plan? |
Agreed that we should ideally avoid overloading While I definitely understand the issue for DatetimeIndex vs PeriodIndex An alternative would be to add a new method to DTI/PI to avoid the conflict? On alternative names for Period's Looking at R's lubridate / Java's JodaTime, they have the concept of durations, periods and intervals, where the duration is essentially our timedelta (absolute length of time in seconds), a period is the calendar time length, and interval is span with specific start/stop instant (so like our Interval but specific to timestamps). Arrow (and some SQL systems) calls the period from JodaTime/lubridate an "interval" , so that could also be an option as mentioned above, but indeed that then conflicts with our Assume we would add a pandas extension dtype for Arrow's interval type of data (i.e. what you can now store as |
I think I am also coming around to liking But as Brock mentioned in the top post, Yet another idea: "span", indicating the time span of the Period (although I don't know if people's first connotation for "time span" is the absolute vs the relative version .., while here it would of course represent a relative time span) (sorry, not being very helpful here in coming closer to a decision ..) |
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 forfreq
in the Period constructor, thenfreq
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