[Numpy-discussion] Inplace index suprise

Gael Varoquaux gael.varoquaux at normalesup.org
Thu Mar 20 14:35:46 EDT 2008


On Thu, Mar 20, 2008 at 06:17:44PM +0000, James Philbin wrote:
> Hi,

> >  This cannot work, because the inplace operation does not
> >  take place as a for loop.
> Well, this would be fine if I was assigning the values to tempories as
> you suggest. However, the operation should be performed inplace and
> this is what I don't understand - why is there no for loop? I think
> the semantics of these inplace indexed operations is intuitively quite
> clear and numpy doesn't follow this intuition. Would there be any
> interest in changing this behaviour in numpy?

I think this is technicaly impossible from the way numpy works. This
breaks the numpy model that every operation is global on the array.

> >  This is a FAQ.
> Sorry if i'm rehashing old ground, but the closest thing I could find
> to a numpy faq is here: http://www.scipy.org/FAQ. There seems to be no
> mention of this issue there.

Sorry if I came out harsh, I certainly didn't want to implie that you
were expecting something wrong, just that this thing was tricking people.

Cheers,

Gaël



More information about the NumPy-Discussion mailing list