Skip to content

Add argmax to GroupBy object #5503

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
cancan101 opened this issue Nov 13, 2013 · 1 comment
Closed

Add argmax to GroupBy object #5503

cancan101 opened this issue Nov 13, 2013 · 1 comment

Comments

@cancan101
Copy link
Contributor

See SO question: http://stackoverflow.com/questions/19879790/indexing-dataframe-by-argmax-of-column-over-another-column

I was thinking something along the lines of:

interesting_rows = raw_data.groupby(["city"]).argmax(over='obt_dt')

which would pull out the row in each group that has the max value in the column referred to by the over keyword,

@jreback
Copy link
Contributor

jreback commented Jan 25, 2014

is is just idxmax which is defined already, the over kw I am confused on. Maybe if you have a complete example it would be more clear.

@jreback jreback closed this as completed Jan 25, 2014
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

No branches or pull requests

2 participants