Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- csv = open('handskrivna.skv')
- rows = []
- for line in csv.readlines()[1:]:
- if line:
- line = line.decode('iso-8859-1')
- (valtyp,_,_,_,_,_,_,_,_,parti,antal) = line.split(';')
- if valtyp == "R":
- for i in xrange(int(antal)):
- rows.append(parti)
- freqs = Counter(rows)
- for (parti, antal) in freqs.most_common():
- print ("<tr><td>%s</td><td>%s</td></tr>" % (parti, antal)).encode('utf-8')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement