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

Extend dataframe groubpy aggregations to accept lists of column names #2749

Closed
stress-tess opened this issue Sep 4, 2023 · 0 comments · Fixed by #2751
Closed

Extend dataframe groubpy aggregations to accept lists of column names #2749

stress-tess opened this issue Sep 4, 2023 · 0 comments · Fixed by #2751
Assignees
Labels
enhancement New feature or request

Comments

@stress-tess
Copy link
Member

Extend dataframe groubpy aggregations to accept lists of column names. Leaving this empty will apply the aggregation to all columns

>>> username = ["Alice", "Bob", "Alice", "Carol", "Bob", "Alice"]
>>> userid = [111, 222, 111, 333, 222, 111]
>>> item = [0, 0, 1, 1, 2, 0]
>>> day = [5, 5, 6, 5, 6, 6]
>>> amount = [0.5, 0.6, 1.1, 1.2, 4.3, 0.6]
>>> p = pd.DataFrame({"userName": username, "userID": userid, "item": item, "day": day, "amount": amount})
>>> p.groupby('userID').first()
       userName  item  day  amount
userID
111       Alice     0    5     0.5
222         Bob     0    5     0.6
333       Carol     1    5     1.2
@stress-tess stress-tess added the enhancement New feature or request label Sep 4, 2023
@stress-tess stress-tess self-assigned this Sep 4, 2023
stress-tess pushed a commit to stress-tess/arkouda that referenced this issue Sep 4, 2023
…ssing aggregations and ability to aggregate on a list column names

This PR (closes Bears-R-Us#2749 and closes Bears-R-Us#1166) add missing aggregations to dataframe groupby and add ability to aggregate on a list of column names.
github-merge-queue bot pushed a commit that referenced this issue Sep 6, 2023
…nd ability to aggregate on a list column names (#2751)

This PR (closes #2749 and closes #1166) add missing aggregations to dataframe groupby and add ability to aggregate on a list of column names.

Co-authored-by: Pierce Hayes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant