I find a Incomprehensible phenomenon this afternoon.I want to exchange two lines in ndarray shown as following code.
import numpy as np
a = np.random.randint(0, 40, size=(4, 4))
a = a + a.T
b = a.copy()
print(a)
b[1], b[3] = b[3], b[1]
print(b)
But an unexpected result came.The printing result as follows
[[60 64 12 33]
[64 30 29 60]
[12 29 40 64]
[33 60 64 76]]
[[60 64 12 33]
[33 60 64 76]
[12 29 40 64]
[33 60 64 76]]
i know a,b = b,a is effective.i want to know what difference between them? Can u talk about this question in terms of memory? thank u in advance!