[Numpy-discussion] detecting shared data

Pierre GM pgmdevlist at gmail.com
Wed Apr 11 18:18:26 EDT 2007


On Wednesday 11 April 2007 18:12:16 Matthew Koichi Grimes wrote:
> Is there any way to detect whether one array is a view into another
>
> array? I'd like something like:
>  >>> arr = N.arange(5)
>  >>> subarr = arr[1:3]
>  >>> sharesdata(arr, subarr)

Mmh, would arr.flags['OWNDATA'] would do the trick ?
p.



More information about the NumPy-Discussion mailing list