Mon, 05 Jul 2010 16:03:56 +0200, Steve Schmerler wrote:
[clip]
> To sum up, I find it a bit subtle that
>     a = a - a[...,0][...,None]
> works as expected, while
>     a -= a[...,0][...,None]
> does not.
> I guess the reason is that in the latter case (and the corresponding
> loop), a[...,0] itself is changed during the loop, while in the former
> case, numpy makes a copy of a[...,0] ?

Correct.

> Is this intended?

Not really. It's a "feature" we're planning to get rid of eventually, 
once a way to do it without sacrificing performance in "safe" cases is 
implemented.

-- 
Pauli Virtanen

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to