Python, memory error, csv file too large [duplicate]
问题 This question already has answers here : Reading a huge .csv file (7 answers) Closed 6 years ago . I have a problem with a python module that cannot handle importing a big datafile (the file targets.csv weights nearly 1 Gb) the error appens when this line is loaded: targets = [(name, float(X), float(Y), float(Z), float(BG)) for name, X, Y, Z, BG in csv.reader(open('targets.csv'))] traceback: Traceback (most recent call last): File "C:\Users\gary\Documents\EPSON STUDIES\colors_text_D65.py",