[Numpy-discussion] Indexing

Stéfan van der Walt stefan at sun.ac.za
Fri Apr 17 08:41:52 EDT 2009


Hi Gerry

2009/4/17 Talbot, Gerry <Gerry.Talbot at amd.com>:
> 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

The fancy indexing (indexing with an array) in ncycle[i] makes a copy,
so you are assigning to a temporary copy which disappears soon after.

Regards
Stéfan



More information about the NumPy-Discussion mailing list