[NumPy-Tickets] [NumPy] #2015: Misleading warning: Line # (got X columns instead of Y)

NumPy Trac numpy-tickets@scipy....
Wed Jan 11 18:21:38 CST 2012


#2015: Misleading warning: Line # (got X columns instead of Y)
-------------------------+--------------------------------------------------
 Reporter:  wes_waugh    |       Owner:  somebody   
     Type:  enhancement  |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  Other        |     Version:  1.5.1      
 Keywords:               |  
-------------------------+--------------------------------------------------
 In .../numpy/lib/npyio.py:1438

 I get this warning pretty frequently when using `usecols`. For example,

 `usecols = [1,15,36,110]`

 but the input data will have only 108 columns. So, I get an error message
 like "Got 104 columns instead of 4". What the heck does that mean? Neither
 4 nor 104 are directly helpful. What I need is the number of columns on a
 line (108) and the column I'm trying to use that isn't present (110).

 Maybe the IndexError on line 1396 could raise a warning like "Line X:
 Trying to use column Y, but only Z columns are present"

 I know this is an older version of numpy -- I'll try upgrading. Thanks!

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


More information about the NumPy-Tickets mailing list