Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- quantities = csv.reader(open("quants.csv", "r"))
- report = list(quantities)
- new_list = []
- for x in report:
- count = 0
- total = 0
- while count<len(report):
- if report[count][0]==x[0]:
- total = total+(int(report[count][1]))
- count+=1
- new_list.append([x[0], total])
- print dict(new_list)
Add Comment
Please, Sign In to add comment