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
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:
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)
The text was updated successfully, but these errors were encountered: