import numpy as np
array_1 = np.array([1,2,3])
array_2 = np.array([4,5,6])
print(id(array_1))
print(id(array_2))
print(f"array id comparison = {id(array_1)==id(array_2)}")
print(id(array_1[0]))
print(id(array_2[0]))
print(f"array item id comparison = {id(array_1[0])==id(array_2[0])}")
Output:
553196994064
553197145904
array id comparison = False
553211404432
553211405200
array item id comparison = True*
The ids of array items are different, but why is the comparison of ids of array items True?