[Numpy-discussion] Indexing

Talbot, Gerry Gerry.Talbot at amd.com
Fri Apr 17 06:20:40 EDT 2009


Hi,

 

I stumbled across this anomaly, the assignment to ncycle[i][b] fails,
yet ncycle[:][b] works and the final print works.  Is this a known bug
or limitation ?  I am running numpy-1.2.1 with python 2.5.4

 

Gerry

 

from numpy import *

 

ncycle = arange(10)

i = array([0, 1,  2,  3,  4,  5,  6, 7])

b = array([True,False]*2)

 

ncycle[i][b] = 99

print ncycle

 

ncycle[:][b] = 99

print ncycle

 

print ncycle[i][b]

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090417/86213c0e/attachment.html>


More information about the NumPy-Discussion mailing list