[Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

Vincent Nijs v-nijs at kellogg.northwestern.edu
Wed Jul 18 02:49:33 EDT 2007


I combined some of the very useful comments/code from Tim and Torgil and
came-up with the attached program to read csv files and convert the data
into a recarray. I couldn¹t use all of their suggestions because, frankly, I
didn¹t understand all of them :)

The program use variable names if provided in the csv-file and can
auto-detect data types. However, I also wanted to make it easy to specify
data types and/or variables names if so desired. Examples are at the bottom
of the file. Comments are very welcome.

Thanks,

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070718/acab3bed/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: load_combi.py
Type: application/octet-stream
Size: 5559 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070718/acab3bed/attachment.obj>


More information about the NumPy-Discussion mailing list