Skip to content

Rolling qcut #10759

Closed
Closed
@Kapik1337

Description

@Kapik1337

I believe qcut would be much more useful if there was a convenient way to apply it to a rolling window instead of the whole Series object. Of course it's possible with rolling_apply, but that does window_size times more calculations that are necessary for the output. For something as trivial as checking how the current value compares to the ones around it, I'm forced to use this monstrosity:

pd.rolling_apply(arg,window,lambda x: pd.qcut(x,q,labels=False)[window/2],center=True)

instead of much more elegant pd.rolling_qcut(arg,window,q,center=True)

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