-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: make 'freq' mean the same thing for PeriodIndex as DTI/TDI #47227
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
Comments
p = period_range("2022", periods=9, freq="M")
print(p.freq)
print(p[::3].freq)
we would also not raise in |
That's what i have in mind, yes. |
So would also add the freq to the PeriodIndex repr?
and for
|
Looking at what this might take, I think for consistency if we deprecate PeriodIndex.freq we'd probably need to do the same for Period.freq, which would in turn likely require deprecating Another option would be to deprecate 'freq' on DTI/TDI and rename it to something else, though again i don't have a good idea of what that something else would be. "interval" came to mind but that would be confusing with pd.Interval. |
ATM PeriodIndex.freq tells us about the index's dtype, while DatetimeIndex.freq tells us about the difference between any two consecutive elements.
Changing PeriodIndex.freq would let us share more code.
update If we do this, we should also deprecate PeriodIndex.is_full, which seems to be a kludge for checking if the index is freq-like in the DTI sense
The text was updated successfully, but these errors were encountered: