Skip to content

Instantly share code, notes, and snippets.

@bast
Created January 16, 2018 11:24
Show Gist options
  • Save bast/737424bf94517a467e8872da77705833 to your computer and use it in GitHub Desktop.
Save bast/737424bf94517a467e8872da77705833 to your computer and use it in GitHub Desktop.
Extracts programming language statistics from our registration data.
import csv
import glob
from collections import Counter
languages = [
'Matlab',
'R',
'Python',
'Perl',
'C',
'C++',
'Fortran 77',
'Fortran 90+',
'Julia',
'Haskell',
'Go',
]
counter = Counter()
for file_name in glob.glob('*.csv'):
with open(file_name) as f:
reader = csv.DictReader(f)
for row in reader:
for language in languages:
if row[language] == language:
counter[language] += 1
print(counter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment