[NumPy-Tickets] [NumPy] #1458: loadtxt doesn't unpack structred arrays with unpack=True

NumPy Trac numpy-tickets@scipy....
Sun Apr 18 11:08:56 CDT 2010


#1458: loadtxt doesn't unpack structred arrays with unpack=True
-----------------------+----------------------------------------------------
 Reporter:  gdub       |       Owner:  somebody
     Type:  defect     |      Status:  new     
 Priority:  normal     |   Milestone:          
Component:  numpy.lib  |     Version:  devel   
 Keywords:             |  
-----------------------+----------------------------------------------------
 The following should work:

 {{{
 #!python
 import numpy; from StringIO import StringIO
 d = StringIO("M 21 72\nF 35 58")
 a,b,c = numpy.loadtxt(d, dtype={'names': ('gender', 'age', 'weight'),
 'formats': ('S1', 'i4', 'f4')}, unpack=True)
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1458>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list