I'd like to assign a value to an element of a numpy array addressed by a list. Is this possible? It seems like the sort of thing you ought to be able to do.
I tried:
q = np.zeros((2,2,2))
index = [0,0,0]
print(index)
q[index]=4.3
print(q)
Which didn't give an error, which is promising, but q is now:
[[[ 4.3 4.3]
[ 4.3 4.3]]
[[ 0. 0. ]
[ 0. 0. ]]]
As opposed to:
[[[ 4.3 0. ]
[ 0. 0.]]
[[ 0. 0. ]
[ 0. 0. ]]]
As I hoped it would be.
Thanks in advance for your help.