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)

Activity

jreback

jreback commented on Aug 10, 2015

@jreback
Contributor

I suppose. Would require some implementation effort, so pull-requests are welcome.

added
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
on Aug 10, 2015
added this to the Someday milestone on Aug 10, 2015
added
cutcut, qcut
Windowrolling, ewma, expanding
and removed
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
on Apr 5, 2020
removed this from the Someday milestone on Oct 13, 2022
mroeschke

mroeschke commented on May 31, 2024

@mroeschke
Member

Seems like there hasn't been much interest in this feature over the years so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @jreback@jbrockmendel@mroeschke@Kapik1337

        Issue actions

          Rolling qcut · Issue #10759 · pandas-dev/pandas