[Numpy-discussion] Indexing with a list...

T J tjhnson@gmail....
Sat Aug 8 23:36:07 CDT 2009


>>> z = array([1,2,3,4])
>>> z[[1]]
array([1])
>>> z[(1,)]
1

I'm just curious: What is the motivation for this differing behavior?

Is it a necessary consequence of, for example, the following:

>>> z[z<3]
array([1,2])


More information about the NumPy-Discussion mailing list