You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
df=pd.DataFrame(np.random.randn(100, 10), index=pd.period_range('19700101', periods=100, freq='H'))
period_resample_with_base=df.resample('24H', base=10).mean().to_timestamp()
ts_resample_with_base=df.to_timestamp().resample('24H', base=10).mean()
ts_resample_no_base=df.to_timestamp().resample('24H').mean()
period_resample_with_base.to_timestamp().equals(ts_resample_with_base) # -> False, should be Trueperiod_resample_with_base.to_timestamp().equals(ts_resample_no_base) # -> True, should be False
Problem description
The base argument is ignored when resampling with PeriodIndex. It seems that the problem lies in pandas.core.resample.TimeGrouper._get_period_bins, where the base option should be applied (as it is in _get_time_bins) to get the start and end of the grouped interval.
At the very least providing the base argument to PeriodIndex resample should raise an exception.
Output of pd.show_versions()
v0.24.0-dev
The text was updated successfully, but these errors were encountered:
Code Sample
Problem description
The base argument is ignored when resampling with PeriodIndex. It seems that the problem lies in
pandas.core.resample.TimeGrouper._get_period_bins
, where the base option should be applied (as it is in_get_time_bins
) to get the start and end of the grouped interval.At the very least providing the base argument to PeriodIndex resample should raise an exception.
Output of
pd.show_versions()
v0.24.0-dev
The text was updated successfully, but these errors were encountered: