Skip to content

Rolling qcut #10759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kapik1337 opened this issue Aug 6, 2015 · 2 comments
Closed

Rolling qcut #10759

Kapik1337 opened this issue Aug 6, 2015 · 2 comments
Labels
cut cut, qcut Enhancement Window rolling, ewma, expanding

Comments

@Kapik1337
Copy link

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)

@jreback
Copy link
Contributor

jreback commented Aug 10, 2015

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

@jreback jreback added the Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff label Aug 10, 2015
@jreback jreback added this to the Someday milestone Aug 10, 2015
@jbrockmendel jbrockmendel added the quantile quantile method label Nov 1, 2019
@mroeschke mroeschke added cut cut, qcut Enhancement Window rolling, ewma, expanding and removed Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff quantile quantile method labels Apr 5, 2020
@mroeschke mroeschke removed this from the Someday milestone Oct 13, 2022
@mroeschke
Copy link
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
Labels
cut cut, qcut Enhancement Window rolling, ewma, expanding
Projects
None yet
Development

No branches or pull requests

4 participants