[Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Ernest Adrogué
Hi, How can it be done? id() doesn't do it: In [238]: a= np.arange(5) In [239]: id(a) == id(a[:]) Out[239]: False Any ideas? Ernest ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Puneeth
2010/9/6 Ernest Adrogué eadro...@gmx.net: Hi, How can it be done? id() doesn't do it: In [238]: a= np.arange(5) In [239]: id(a) == id(a[:]) Out[239]: False Any ideas? Checking for a[:].base and a[:].size works. I'm not sure if that is a good way to do it. (a[:].base is a and a[:].size

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Gael Varoquaux
On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: Hi, How can it be done? np.may_share_memory ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Ernest Adrogué
5/09/10 @ 21:25 (+0200), thus spake Gael Varoquaux: On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: Hi, How can it be done? np.may_share_memory Thanks Gael and Puneeth. I think the .base attribute is enough for what I want. Bye :)

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Robert Kern
2010/9/5 Ernest Adrogué eadro...@gmx.net:  5/09/10 @ 21:25 (+0200), thus spake Gael Varoquaux: On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: Hi, How can it be done? np.may_share_memory Thanks Gael and Puneeth. I think the .base attribute is enough for what I want.

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Ernest Adrogué
5/09/10 @ 15:59 (-0500), thus spake Robert Kern: 2010/9/5 Ernest Adrogué eadro...@gmx.net:  5/09/10 @ 21:25 (+0200), thus spake Gael Varoquaux: On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: Hi, How can it be done? np.may_share_memory Thanks Gael and Puneeth.

Re: [Numpy-discussion] test if two arrays share the same data

2010-09-05 Thread Anne Archibald
2010/9/5 Ernest Adrogué eadro...@gmx.net:  5/09/10 @ 15:59 (-0500), thus spake Robert Kern: 2010/9/5 Ernest Adrogué eadro...@gmx.net:  5/09/10 @ 21:25 (+0200), thus spake Gael Varoquaux: On Sun, Sep 05, 2010 at 09:12:34PM +0200, Ernest Adrogué wrote: Hi, How can it be done?