-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Resample on empty Period-Indexed Series returns Datetime-Indexed Series #12868
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
@jreback Lots of issues with PeriodIndex & resample. ref: #12774 & #12770 I didn't really follow the resample refactor so I don't know the genesis of these. I had a look through the current code but can't find easy fixes. Looks like a lot is reliant on the Do you have any ideas for an overarching strategy for these? |
@MaximilianR I commented on this in #12774 . The logic from < 0.18.0 is exactly the same. The problem is the period is not systematically tested and there are quite a few edge cases. Further compounding this is the So what we need is a fair amount of systematic testing. Then remove the |
I'll make a master Period Resample issue I think. |
OK - can I confirm that you think this is the best path forward, for all PeriodIndex resampling?
OK, these are regressions though (from our unit tests failing on our upgrade) |
if u have failing tests then they must be things that are not tested in pandas - nothing regressed AFAICT |
Code Sample, a copy-pastable example if possible
In [7]: pd.Series([], pd.period_range(start='2000', periods=0)).resample('W').mean().index Out[7]: DatetimeIndex([], dtype='datetime64[ns]', freq='W-SUN')
Expected Output
PeriodIndex([], dtype='int64', freq='W-SUN')
On pandas: 0.18.0
The text was updated successfully, but these errors were encountered: