In the following piece of code:
>>> import numpy as N
>>> R = N.arange(9).reshape(3,3)
>>> ax = [1,2]
>>> R
array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
>>> R[ax,:][:,ax] = 100
>>> R
array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
Why R is not updated?
I was expecting:
>>> R
array([[0, 1, 2],
[3, 100, 100],
[6, 100, 100]])
I am using numpy 1.04 on gentoo-linux/amd64
Nadav