[Numpy-discussion] Indexing

Talbot, Gerry Gerry.Talbot@amd....
Fri Apr 17 08:14:00 CDT 2009

Got it - Thanks


-----Original Message-----
From: numpy-discussion-bounces@scipy.org [mailto:numpy-discussion-bounces@scipy.org] On Behalf Of Stéfan van der Walt
Sent: Friday, April 17, 2009 8:42 AM
To: Discussion of Numerical Python
Subject: Re: [Numpy-discussion] Indexing

Hi Gerry

2009/4/17 Talbot, Gerry <Gerry.Talbot@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.

Numpy-discussion mailing list

More information about the Numpy-discussion mailing list