[Numpy-discussion] Comparing x and x.view

Christopher Barker Chris.Barker@noaa....
Thu Feb 8 12:43:55 CST 2007

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 arrays over-lap.
>  >>> may_share_memory(a, flipud(a))
> True
> This is based on another utility function byte_bounds that returns the 
> byte-boundaries of any object exporting the Python side of the array 
> interface.
> Perhaps these utilities will help (I know they can be used to make the 
> who function a bit more intelligent about how many bytes are being used).
> -Travis

Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list