Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xlrd
- import sys
- res = {}
- rb = xlrd.open_workbook(sys.argv[1])
- sheet = rb.sheet_by_index(0)
- for rownum in range(sheet.nrows):
- row = sheet.row(rownum)
- d = row[0]
- amount = row[4]
- desc = row[11]
- if amount.value > 2000:
- #print d.value, amount.value, desc.value
- if res.get(desc.value):
- res[desc.value] += amount.value
- else:
- res[desc.value] = amount.value
- for k,v in res.items():
- print k, v
Add Comment
Please, Sign In to add comment