Created
July 30, 2010 22:10
-
-
Save neilkod/501403 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from collections import defaultdict | |
cnts = defaultdict(int) | |
for line in sys.stdin: | |
line = line.strip() | |
k,v = line.split('\t') | |
(item1,item2)=k.split(',') | |
cnts[(int(item1),int(item2))] += 1 | |
for key,val in cnts.items(): | |
print '%s\t%s' % (key,val) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment