Bonus bonus easy to read one-liner (using numpy):
numpy.loadtxt("big-data.csv",delimiter=',').sum(axis=0)This is a nice data-processing trick, but obviously runs very little Python code.
The script from the blog takes 7.3 seconds to chew through it on my machine with Python 2.7.8, and 4.9-5.5 seconds with PyPy, a reasonable improvement. Out of interest, taking all the boilerplate and checking off, the following is 7 lines versus the 24 lines or so in the blog and runs in a similar 4.9-5.4 second range on PyPy (although performance blows out under Python 2.7.8 to 13 seconds or ~6 seconds slower than the blog). Somewhat more Pythonic, and more likely do be done live in the REPL without even bothering to write a script, to my mind.
Above on PyPy. wc on the same machine. Bonus one-liner (6.6 seconds under PyPy).