a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
b = a[1:7:2]
id(a)
id(b)
b[0] = 999
a
b
a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
b = a[[0, 3, 5]]
b
b[0] = 999
a
b
a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
b = a[a]
b
b[0] = 99
a
b
Python arrays are automatically copying each other