Last active
August 29, 2015 14:13
-
-
Save jweede/8bd71917d926532f2dcb to your computer and use it in GitHub Desktop.
quick script for survey results
This file contains 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
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