I learned that in numpy, given a vector, slicing and indexing could give different results. I ran the following codes:
a = np.array([1, 2]) b = np.array([3, 4, 5]) print(b[a]) c = b[1:] print(b) c = 1 print(b) print(c) print(b[1:] is c)
and get the result:
[4 5] [3 4 5] [3 1 5] [1 5] False
Since when I modify c, b is also changed, that means I should have a True in the last line right? Why it is not the case?
Thank you for any help!