[Numpy-discussion] save data to csv with column names

Guillaume Chérel guillaume.c.cherel@gmail....
Mon Aug 16 08:46:28 CDT 2010


Hello,

I'd like to know if there is an easy way to save a list of 1D arrays to a
csv file, with the first line of the file being the column names.

I found the following, but I can't get to save the column names:

data = rec.array([X1,X2,X3,X4], names=[n1,n2,n3,n4])
savetxt("filename", data, delimiter=",", fmt=["%i","%d", "%f","%f"])

Thank you,
Guillaume
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100816/ea7deda0/attachment.html 


More information about the NumPy-Discussion mailing list