Alex Rivera | Logout

How do I read CSV data into a record array in NumPy?

Asked 2010-08-19T04:41:53.677
583

Is there a direct way to import the contents of a CSV file into a record array, just like how R's read.table(), read.delim(), and read.csv() import data into R dataframes?

Or should I use csv.reader() and then apply numpy.core.records.fromrecords()?

Edit
Report

1 Answer

71

You can also try recfromcsv() which can guess data types and return a properly formatted record array.

answered 2011-01-18T12:44:35.260

Your Answer