Skip to content
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

Add cumsum #251

Draft
wants to merge 60 commits into
base: main
Choose a base branch
from
Draft

Add cumsum #251

wants to merge 60 commits into from

Conversation

Illviljan
Copy link
Contributor

No description provided.

Copy link
Collaborator

@dcherian dcherian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting to see!

flox/aggregations.py Show resolved Hide resolved
flox/aggregations.py Show resolved Hide resolved
flox/core.py Outdated Show resolved Hide resolved
a = np.array([3, 4, 1, 3, 9, 9, 6, 7, 7, 0, 8, 2, 1, 8, 9, 8])
b = npg.aggregate(group_idx, a, func="cumsum")

bb = groupby_reduce(a, group_idx, func="cumsum", engine="numpy")[0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a groupby_accumulate(a, group_idx, func="sum", engine="numpy) that only returns a single array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan that groupby_reduce and groupby_accumulate wont have the same typing though.

Copy link
Collaborator

@dcherian dcherian Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are very different operations so they have to be. For e.g. method="map-reduce" isn't applicable. fill_value doesn't make any sense I don't think (an initial value does)

flox/core.py Outdated Show resolved Hide resolved
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
flox/core.py Outdated Show resolved Hide resolved
flox/core.py Outdated Show resolved Hide resolved
flox/core.py Outdated Show resolved Hide resolved
flox/aggregations.py Outdated Show resolved Hide resolved
flox/aggregations.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants