Re: [Numpy-discussion] Comparing x and x.view

2007-02-08 Thread Pierre GM
On Wednesday 07 February 2007 23:09:16 Travis Oliphant wrote: > > So, there's no real point in using the Python 'id' function ? Do we need > > a shortcut to __array_interface__['data'] as id number ? > > You have it (sort of a short-cut). > > .ctypes.data OK, great, thanks a lot On Wednesday 07 F

Re: [Numpy-discussion] Comparing x and x.view

2007-02-08 Thread Christopher Barker
Pierre GM wrote: > I want to compare whether two arrays point to the same data. Travis just posted a note about a couple utility functions that may help: Travis Oliphant wrote: > In SVN there is a new function may_share_memory(a,b) which will return > True if the memory foot-print of the two ar

Re: [Numpy-discussion] Comparing x and x.view

2007-02-07 Thread Robert Kern
Pierre GM wrote: > On Wednesday 07 February 2007 22:38:30 Robert Kern wrote: >> Pierre GM wrote: >>> All, >>> >>> I want to compare whether two arrays point to the same data. >>> I've been using 'is' so far, but I'm wondering whether it's the right >>> approach. >> It isn't. Your analysis is correc

Re: [Numpy-discussion] Comparing x and x.view

2007-02-07 Thread Travis Oliphant
Pierre GM wrote: > On Wednesday 07 February 2007 22:38:30 Robert Kern wrote: > >> Pierre GM wrote: >> >>> All, >>> >>> I want to compare whether two arrays point to the same data. >>> I've been using 'is' so far, but I'm wondering whether it's the right >>> approach. >>> >> It isn't.

Re: [Numpy-discussion] Comparing x and x.view

2007-02-07 Thread Pierre GM
On Wednesday 07 February 2007 22:38:30 Robert Kern wrote: > Pierre GM wrote: > > All, > > > > I want to compare whether two arrays point to the same data. > > I've been using 'is' so far, but I'm wondering whether it's the right > > approach. > > It isn't. Your analysis is correct. So, there's no

Re: [Numpy-discussion] Comparing x and x.view

2007-02-07 Thread Robert Kern
Pierre GM wrote: > All, > > I want to compare whether two arrays point to the same data. > I've been using 'is' so far, but I'm wondering whether it's the right > approach. It isn't. Your analysis is correct. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

[Numpy-discussion] Comparing x and x.view

2007-02-07 Thread Pierre GM
All, I want to compare whether two arrays point to the same data. I've been using 'is' so far, but I'm wondering whether it's the right approach. If x is a plain ndarray, `x is x`, and `x is not x.view()`. I understand the second one (I think so...), `x` and `x.view `are two different Python