Guest User

Untitled

a guest
Jan 11th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. kgislData = open("C:\\kgisl.csv").read().splitlines()
  2. countByDegree = {}
  3. for i in kgislData:
  4. degree = i.split("\t")[3] #CSE
  5. if(countByDegree.has_key(degree)):
  6. countByDegree[degree] = countByDegree[degree] + 1
  7. else:
  8. countByDegree[degree] = 1 #{"CSE" : 1}
  9.  
  10. for i in countByDegree:
  11. print(i + "\t" + str(countByDegree[i]))
Add Comment
Please, Sign In to add comment