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

[FEA] return first n rows of each group, after doing groupby with cudf. #4157

Closed
rnyak opened this issue Feb 14, 2020 · 1 comment
Closed
Labels
feature request New feature or request

Comments

@rnyak
Copy link
Contributor

rnyak commented Feb 14, 2020

Is your feature request related to a problem? Please describe.
I'd like to be able to return first n rows of each group, after doing groupby with cudf. This can be done with pdf as follows:

import pandas as pd
pdf = pd.DataFrame({'id6': 4*list(reversed(range(3))), 'v3': 3*list(range(4))})

pdf[['id6', 'v3']].sort_values('v3', ascending=False).groupby(['id6']).head(2)

       id6	v3
3	2	3
7	1	3
11	0	3
2	0	2
6	2	2
10	1	2

But cudf generates:

``DataFrameGroupBy' object has no attribute 'head'` attribute error.

Describe alternatives you've considered
I could not find an alternative solution yet.

@rnyak rnyak added Needs Triage Need team to review and classify feature request New feature or request labels Feb 14, 2020
@rnyak rnyak changed the title [FEA] [FEA] return first n rows of each group, after doing groupby with cudf. Feb 14, 2020
@beckernick
Copy link
Member

Thanks for the issue! Closing this as a duplicate of #2592 to consolidate discussion.

@bdice bdice removed the Needs Triage Need team to review and classify label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants