Skip to content

Instantly share code, notes, and snippets.

@jweede
Last active August 29, 2015 14:13
Show Gist options
  • Save jweede/8bd71917d926532f2dcb to your computer and use it in GitHub Desktop.
Save jweede/8bd71917d926532f2dcb to your computer and use it in GitHub Desktop.
quick script for survey results
import sys
import csv
from collections import Counter
from itertools import chain
with open(sys.argv[1], 'rb') as csvfile:
dreader = csv.DictReader(csvfile)
key = 'What are you interested learning about more?'
c = Counter(chain.from_iterable(
row[key].split(', ')
for row in dreader
))
for name, count in c.most_common():
print("{}: {}".format(name, count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment