I have a dataset as follows:
name | $ | letter
adam, 34, c
beny, 45, e
adam, 55, a
beny, 87, t
I'd like to extract the max $ donated by each name, with the respective letter. So for Adam, I would get: adam,55,a.
If I use:
df.groupby('name')[['$']].max()
that doesn't give me the respective letter.
If I use:
df.groupby('name')[['$','letter']].max()
I get the max $ and the highest letter in the alphabet.