Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas groupby min get index

df.loc[df.groupby('A').B.idxmin()]

   A  B   C
2  1  2  10
4  2  4   4
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #groupby #min #index
ADD COMMENT
Topic
Name
3+6 =