[NumPy-Tickets] [NumPy] #2217: 1d array can't be accessed with a tuple.

NumPy Trac numpy-tickets@scipy....
Thu Sep 20 04:37:23 CDT 2012


#2217: 1d array can't be accessed with a tuple.
------------------------+---------------------------------------------------
 Reporter:  laket       |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  1.6.1      
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by seberg):

 It is not a bug, its a detail about how python parses tuples (and the
 slice syntax). (`c[0,1]` parses to the same thing as `c[(0,1)]`).

 The simple fix is, always use lists or arrays for fancy indexing. Numpy
 tolerates tuples in many cases like the second, but it simply cannot allow
 them in general.

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


More information about the NumPy-Tickets mailing list