Find maximum value of a column and return the corresponding row values using Pandas
Assuming df has a unique index, this gives the row with the maximum value: In [34]: df.loc[df[‘Value’].idxmax()] Out[34]: Country US Place Kansas Value 894 Name: 7 Note that idxmax returns index labels. So if the DataFrame has duplicates in the index, the label may not uniquely identify the row, so df.loc may return more than … Read more