Pandas max value index

Use argmax() idxmax() to get the index of the max value. Then you can use loc

df.loc[df['favcount'].idxmax(), 'sn']

Edit: argmax() is now deprecated, switching for idxmax()

Leave a Comment