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
It is currently possible to define custom window rolling as explained in documentation.
It is required to subclass BaseIndexer and define ones' own get_window_bounds.
In case windows' bounds are defined by timestamps, pandas already provide a nice API to define them as pd.IntervalIndex.
Requested feature is to have rolling accepting pd.IntervalIndex in window parameter, that would be used in combination with on parameter to define the datetime-like column (already the case apparently)
API breaking implications
window parameter accepts pd.IntervalIndex
Additional context
This operation could be managed by use of pd.IntervalIndex and pd.cut but this combination does not take advantage that:
intervals are sorted and non overlapping
datetime-like column is sorted
which allows then to go through the DataFrame only once, managing each intervals one after the other.
I think that rolling naturally does.
The text was updated successfully, but these errors were encountered:
Hi,
Sorry, I think I made a mix between 'rolling' and 'resample/groubly'. I have open ticket #41212 with a similar request, but focused on 'resample' and providing a more detailed use case. I am closing this one. Sorry for the mistake.
Uh oh!
There was an error while loading. Please reload this page.
Describe the solution you'd like
It is currently possible to define custom window rolling as explained in documentation.
It is required to subclass
BaseIndexer
and define ones' ownget_window_bounds
.In case windows' bounds are defined by timestamps, pandas already provide a nice API to define them as
pd.IntervalIndex
.Requested feature is to have rolling accepting
pd.IntervalIndex
inwindow
parameter, that would be used in combination withon
parameter to define the datetime-like column (already the case apparently)API breaking implications
window
parameter acceptspd.IntervalIndex
Additional context
This operation could be managed by use of
pd.IntervalIndex
andpd.cut
but this combination does not take advantage that:which allows then to go through the DataFrame only once, managing each intervals one after the other.
I think that rolling naturally does.
The text was updated successfully, but these errors were encountered: