On 9/12/2011 7:18 AM, Jonas Wallin wrote:
> Why does
>
>      MuY += MuY.transpose()
>
> and
>
>     MuY = MuY + MuY.transpose()
>
> give different answers?


Because the first one is done in-place,
so you are changing MuY (and thus MuY.transpose)
as the operation proceeds.

MuY.transpose() is generally a *view* of MuY.
http://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.html

Use the second one.

Alan Isaac


_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to