| 1 | initial version |
I typically use the following:
import csv
data=list( csv.reader(open('myfile.csv','rU')) )
The data is read into a list as strings. Then, you can convert to another data type. For example, you can convert to integers as follows:
data=map(lambda x: int(x),data)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.