[Numpy-discussion] checking identity of arrays?

rlw at stsci.edu rlw at stsci.edu
Fri Feb 23 09:51:11 CST 2001


John J. Lee:

>I must be missing something obvious: how does one check if two variables
>refer to the same array object?

Paul Dubois:

>if a is b:

I thought he was asking something different.  Suppose I do this:

a = zeros(100)
b = a[10:20]

Now b is a view of a's data.  Is there any way to test that
a and b refer to the same data?  (Even if this was not John's
question, I'm curious to know the answer.)




More information about the Numpy-discussion mailing list