I want to make a list from the following data:
Ramesh CUB 10000
Rajesh IndianBank 20000
Ramesh CUB 20000
Arya ICICI 200000
Ramesh ICICI 20000
Rajesh KVB 30000
Vimala SBI 3000
Vimala YesBank 200000
Rajesh IndianBank 2000
such that Money from strings with same name and bank is added to get: Expected Output
Ramesh CUB 40000
Ramesh ICICI 20000
Rajesh IndianBank 22000
Rajesh KVB 30000
Arya ICICI 202000
Vimala SBI 33000
Vimala YesBank 200000
itertools.groupby(before grouping you need to sort the data tho), or use the equivalent withpandas(which may be actually simpler)