I have a dataframe that roughly looks like this:

I could group and sort them with df_players.groupby(['vehicle']).agg({'frags':sum}).sort_values(['frags'],ascending=False)

How can I group the vehicles and get their win rates just like this:

EDIT: (data)
[ {"player": "bob", "vehicle": "a", "hasWon": True, "frags": 5}, {"player": "foo", "vehicle": "b", "hasWon": False, "frags": 3}, {"player": "bar", "vehicle": "c", "hasWon": True, "frags": 2} ] 
