Skip to content

feature request: rolling with datetime range #13327

Closed
@randomgambit

Description

@randomgambit

Hello everyone,

I would like to submit one very useful addition to rolling, namely the possibility to compute any statistics over a specific time range.

Indeed, my understanding is that rolling(windows=5).mean() computes, say, the mean over the last five observations.

Instead, it would be very useful to specify something like `rolling(windows=5,type_windows='time_range').mean() to get the rolling mean over the last 5 days.

So if your data starts on January 1 and then the next data point is on Feb 2nd, then the rolling mean for the Feb 2nb point is NA because there was no data on Jan 29, 30, 31, Feb 1, Feb 2.

I believe this would be very useful in settings where data represents trading data, so most of the time the data points are not equidistant in time. Still, you want to compute rolling metrics that are specified over the same delta.

What do you think?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions