-
Notifications
You must be signed in to change notification settings - Fork 590
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
Compute cumulative values in a groupby #540
Comments
Hi Jérémie, thanks! Would it help by doing an approximation? You could do a binby, to do a 2d histogram (with sum aggregation), and do a sum in the final direction? # assume class is a categorical/ordinal
X = df.binby([df['class'], df['x']], agg={'x': 'sum'}, limits=[None, [0, 100]], shape=[None, 1000])
c = np.cumsum(X, axis=1) cheers, Maarten |
Thanks a lot for your answer Maarten,
Best regards, |
Hi any news on having cumsum implemented in vaex? I think this is really relevant when best Francesco |
Do we have cumsum/cumsum support in groups now in this wonderful library ? |
Hi all,
First of all, thank you for this really cool lib. I discovered it few days ago, and I am starting to understand its philosophy.
I face a problem, I guess someone would give me some insight.
I am trying to compute the cumulative sum of a variable based on a group.
The straight solution
df['cum_sum'] = df.groupby("class", agg={'x': 'cumsum'})
does not work because cumsum() is not supported in vaex.
The workaround I use is to move to pandas, compute what I want and come back to vaex. Here is an example of my current solution :
Do you think a solution with the current state of vaex is possible ?
Thanks a lot
The text was updated successfully, but these errors were encountered: