Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import csv
- import sys
- print "Sorting GDG Attendees"
- #with open('GLYNNRORY-20130127.csv', 'rb') as f:
- with open(sys.argv[1], 'rb') as f:
- reader = csv.reader(f)
- #ssToFind = raw_input("What are we looking for? ")
- #HashMap of email addresses (Python Dictionary)
- emailMap = {};
- for row in reader:
- if row[3] in emailMap:
- if len(row[4])>3:
- values = emailMap[row[3]]
- #broken here
- values[0] = values[0]+1
- else:
- values = emailMap[row[3]]
- values[1] +=1
- else:
- if len(row[4])>3:
- emailMap[row[3]] = {1,0}
- else:
- emailMap[row[3]] = {0,1}
- for key, value in emailMap.iteritems():
- print key+" - ",+value[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement