-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
ENH: implement nlargest
and nsmallest
for DataFrameGroupBy like SeriesGroupBy
#46924
Labels
API - Consistency
Internal Consistency of API/Behavior
Enhancement
Groupby
Series
Series data structure
Comments
yoch
added
Enhancement
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
May 2, 2022
yoch
changed the title
ENH: implement
ENH: implement May 2, 2022
nlargest
for DataFrameGroupBynlargest
and nsmallest
for DataFrameGroupBy like SeriesGroupBy
In fact, this can be done exactly in the same way than pandas/pandas/core/groupby/generic.py Lines 744 to 760 in 4bfe3d0
|
simonjayhawkins
added
Groupby
Numeric Operations
Arithmetic, Comparison, and Logical operations
API - Consistency
Internal Consistency of API/Behavior
labels
May 4, 2022
If still open, I would like to work on this issue. |
take |
4 tasks
lithomas1
removed
the
Needs Triage
Issue that has not been reviewed by a pandas team member
label
Aug 18, 2022
jbrockmendel
removed
the
Numeric Operations
Arithmetic, Comparison, and Logical operations
label
Mar 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API - Consistency
Internal Consistency of API/Behavior
Enhancement
Groupby
Series
Series data structure
The
DataFrameGroupBy
should get a new methodnlargest
to allow selecting the N largest rows for each group.Currently this is doable by using
df.sort_values(...).groupby(...).head(n)
but I want to use thekeep='all'
parameter ofnlargest
which cannot be obtained withhead
The text was updated successfully, but these errors were encountered: