Skip to content

Instantly share code, notes, and snippets.

@miggyb
Created February 7, 2014 05:45
Show Gist options
  • Save miggyb/8857896 to your computer and use it in GitHub Desktop.
Save miggyb/8857896 to your computer and use it in GitHub Desktop.
// Hi /r/mylittlepony!
// This code is released under the WTFPL
// http://www.wtfpl.net/about/
from collections import defaultdict
f = open('output.csv', 'r')
flair = defaultdict(int)
for line in f:
flair[line.split(',')[1][:-2]] += 1
del flair['None']
del flair['']
for pony in sorted(flair, key=flair.get, reverse=True):
print "%s,%s" % (pony, str(flair[pony]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment