Say I have a pandas data frame like the following:
test = pd.DataFrame({'name':['John', 'David', 'John', 'Bob', 'Bob', 'Tim'], 'count' : [4, 5, 3, 2, 2, 1]})
How can I make a new data frame which merges the count values (adds) based on the values in the name column?
The final result for this example should be:
count name
0 7 John
1 5 David
2 4 Bob
3 1 Tim