I read a csv file using pandas:
data_raw = pd.read_csv(filename, chunksize=chunksize)
print(data_raw['id'])
Then, it reports TypeError:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'TextFileReader' object has no attribute '__getitem__'
What can I do to resolve the problem? And how can I change the data_raw into a dataFrame object?
I use the python2.7 and pandas v0.19.1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…