I was trying to process my huge CSV file (more than 20G), but the process was killed when reading the whole CSV file into memory. To avoid this issue, I am trying to read the second column line by line.
For example, the 2nd column contains data like
- xxx, computer is good
xxx, build algorithm
import collections wordcount = collections.Counter() with open('desc.csv', 'rb') as infile: for line in infile: wordcount.update(line.split())
My code is working for the whole columns, how to only read the second column without using CSV reader?
for something in descs:to iterate over results one by one. You probably have to omit the.tolist(). Again, I don't know the libraries, so I can not tell you the proper way