Skip to content

ENH/API: add nlargest/nsmallest to DataFrame #7359

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

Closed
cpcloud opened this issue Jun 5, 2014 · 2 comments
Closed

ENH/API: add nlargest/nsmallest to DataFrame #7359

cpcloud opened this issue Jun 5, 2014 · 2 comments
Assignees
Milestone

Comments

@cpcloud
Copy link
Member

cpcloud commented Jun 5, 2014

xref: #7356

API like:

df.nlargest('column_name', 3)

impl like:

def nlargest(self, col, n):
    return self.loc[self[col].nlargest(n).index]

cc @hayd

@cpcloud cpcloud added this to the 0.14.1 milestone Jun 5, 2014
@cpcloud cpcloud self-assigned this Jun 5, 2014
@cpcloud
Copy link
Member Author

cpcloud commented Jun 6, 2014

@jreback i think actually you can do you something like and you can have a partial nested sort ...

def nlargest(self, columns, n):
    return self.loc[self[columns[0]].nlargest(n).index].sort(columns)

@cpcloud
Copy link
Member Author

cpcloud commented Jun 6, 2014

i'll move to 0.15 i think maybe mull over a bit

@cpcloud cpcloud modified the milestones: 0.15.0, 0.14.1 Jun 6, 2014
@jreback jreback modified the milestones: 0.15.0, 0.15.1 Jul 6, 2014
@jreback jreback modified the milestones: 0.15.1, 0.15.0 Sep 4, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jreback jreback modified the milestones: 0.17.0, Next Major Release Jun 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants