[Numpy-discussion] checking identity of arrays?

rlw at stsci.edu rlw at stsci.edu
Fri Feb 23 10:51:11 EST 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