[Numpy-discussion] genfromtxt behaviour

Matt Studley matt.studley@gmail....
Fri Oct 29 07:59:27 CDT 2010


>> How can I do my nice 2d slicing on the latter?
>> array([('a', 2, 3), ('b', 5, 6), ('c', 8, 9)],
>>      dtype=[('f0', '|S1'), ('f1', '<i4'), ('f2', '<i4')])

>Select a column by its name:


So I would need to get the dtype object...

myData[ myData.dtype.names[0] ]

in order to index by column.


More information about the NumPy-Discussion mailing list