Why does this
import numpy as np
a = np.array([[1,2,3],[4,5,6]])
a_old = a[0]
a[0] = a[0] + np.array([1,1,1])
print(a[0] - a_old)
give
[0 0 0]
and not
[1 1 1]
? But on the other hand
b = 2
b_old = b
b = b + 1
print(b - b_old)
gives indeed
1
as I would expect. I suppose there is a difference between assigning something to np.array elements, and assigning something to a variable. But I don't quite see through it. Thanks for help!