Open numpy-gitbot opened 12 years ago
trac user seberg wrote on 2012-09-20
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.
Original ticket http://projects.scipy.org/numpy/ticket/2217 on 2012-09-18 by trac user laket, assigned to unknown.
Using a tuple to access elements of 1d array, I got IndexError,
When I accessed 2d array with a tuple, I got expected result.
Python : 2.7.3 Numpy : 1.6.1 OS : Ubuntu 12.04