[NumPy-Tickets] [NumPy] #1071: loadtxt fails if the last column contains empty value

NumPy Trac numpy-tickets@scipy....
Thu Mar 31 14:43:04 CDT 2011


#1071: loadtxt fails if the last column contains empty value
---------------------------------+------------------------------------------
 Reporter:  Electrion            |       Owner:  somebody    
     Type:  defect               |      Status:  needs_review
 Priority:  normal               |   Milestone:  1.6.0       
Component:  numpy.lib            |     Version:  devel       
 Keywords:  loadtxt ascii strip  |  
---------------------------------+------------------------------------------

Comment(by bsouthey):

 Replying to [comment:5 derek]:
 If I just use 'line = line.split(comments)[0].strip('\r\n')' in version
 2.0.0.dev-7134a93 then this example now works for me.
 {{{
 >>> np.loadtxt(StringIO("0 \t1\n2 \t "), delimiter='\t', converters=cnv)
 array([[  0.,   1.],
        [  2.,  nan]])
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1071#comment:7>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list