Last active
January 2, 2016 21:49
-
-
Save mrocklin/8365524 to your computer and use it in GitHub Desktop.
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
from toolz import groupby, first | |
from sys import argv | |
filename = argv[1] | |
with duration(): | |
file = open(filename) | |
lines = map(str.strip, file) | |
word_pairs = map(lambda s: s.split(','), lines) | |
result = groupby(first, word_pairs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment