[Numpy-discussion] data type specification when using numpy.genfromtxt

Chao YUE chaoyuejoy@gmail....
Sun Jun 26 13:48:26 CDT 2011


Dear all numpy users,

I want to read a csv file with many (49) columns, the first column is string
and remaning can be float.
how can I avoid type in like

data=numpy.genfromtxt('data.csv',delimiter=';',names=True, dtype=(S10,
float, float, ......))

Can I just specify the  type of first cloumn is tring and the remaing float?
how can I do that?

Thanks a lot,

Chao

-- 
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 77 30; Fax:01.69.08.77.16
************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110626/a8721974/attachment.html 


More information about the NumPy-Discussion mailing list