4 ms·
collections.Counter in Python 2.7 was not speedy at the time of this Stack Overflow question: https://stackoverflow.com/questions/27801945/surprising-results-w
by maxerickson 9y ago
collections.Counter in Python 2.7 was not speedy at the time of this Stack Overflow question:
https://stackoverflow.com/questions/27801945/surprising-results-with-python-timeit-counter-vs-defaultdict-vs-dict https://stackoverflow.com/questions/27801945/surprising-resu...
Another likely optimization would be to use the csv module (which would parse the rows in C).