with open('test.csv') as f:
reader = csv.reader(f, skipinitialspace=True, delimiter = ';')
header = next(reader)
a = [dict(zip(header, row)) for row in reader]
Basically, with the above code I am transforming a csv into a list of dictionaries it is working for small csv files however, for my 500 MB one I am having errors. I am fairly new to the company and do not want to seem like a n00b so is there a way to do this while making it run on 32 bit addresses ?
P.S: I tried csv.DictReader
and it didn't work
Traceback (most recent call last):
File "<input>", line 3, in <module>
File "c:\python27\Lib\csv.py", line 116, in next
d = dict(zip(self.fieldnames, row))
MemoryError