Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (17 sloc) 0.503 kB
# -*- coding: utf-8 -*-
import re, operator
locations = {}
totalcnt = 0
for line in open('unresolved_locations.txt','r'):
loc, cnt = line.rsplit(',', 1)
cnt = int(cnt.strip())
loc = loc.strip().lower()
if '' == loc: continue
if loc not in locations:
locations[loc] = 0
locations[loc] += cnt
totalcnt += cnt
print totalcnt
locsorted = sorted(locations.iteritems(), key=operator.itemgetter(1), reverse=True)
for loc, cnt in locsorted:
print '%s\t%d' % (loc, cnt)
Jump to Line
Something went wrong with that request. Please try again.