Guest User

Untitled

a guest
Apr 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import xlrd
  2. import sys
  3.  
  4.  
  5. res = {}
  6.  
  7. rb = xlrd.open_workbook(sys.argv[1])
  8. sheet = rb.sheet_by_index(0)
  9. for rownum in range(sheet.nrows):
  10. row = sheet.row(rownum)
  11. d = row[0]
  12. amount = row[4]
  13. desc = row[11]
  14. if amount.value > 2000:
  15. #print d.value, amount.value, desc.value
  16. if res.get(desc.value):
  17. res[desc.value] += amount.value
  18. else:
  19. res[desc.value] = amount.value
  20.  
  21. for k,v in res.items():
  22. print k, v
Add Comment
Please, Sign In to add comment