Basic basic question but can't get it right. I'm trying to sort by scores and then get the top name associated with the top score.
import pandas as pd
df = pd.DataFrame({'score' :[1,5,7,999], 'name':['jack','jill','chris','kevin']})
df.sort_values(by= 'score', ascending=False, inplace=True)
df
df.name[0]
However with this approach I get Jack instead of Kevin since it seems to be going by the order the names appeared in the data frame creation. What's the obvious thing I am missing?