2 ms·
Why in the world do you want to use the standard library only? This is what Pandas was designed for, with optimized C code. What are you doing which is differe
by eesmith 8y ago
Why in the world do you want to use the standard library only? This is what Pandas was designed for, with optimized C code.
What are you doing which is different from something like:
totals = []
for line in open(filename, "rb"):
fields = line.split()
totals.append(fields[2]) # or whatever
totals.sort()
... do something ..
or using collections.Counter()
with open(filename, "rb") as f:
c = collections.Counter(line.split()[2] for line in f)
print(c.most_common(10))
- enz 8y agoYes, Pandas is what you need. And its CSV processor is really fast compared to the standard CSV module.