NumPy | shares_memory method
Start your free 7-days trial now!
shares_memory(~) method returns True if the two input arrays share the same memory.
The first input array.
The second input array.
The maximum number of checks to perform when comparing memory location:
The inner contents of the array are checked. True is returned only if there is at least a pair of elements that shares the same memory.
Only the two bounds occupied by the arrays are checked.
A single boolean where True means that the two input arrays share the memory.
a = np.array([1,2])b = np.array([1,2])np.shares_memory(a,b)False
a = np.array([1,2])b = anp.shares_memory(a,b)True