I would like to check if two ndarrays are overlapping representations of the same base ndarray.
To verify that the two slices are the same, I can do something like:
a.base is b.base and a.shape == b.shape and a.data == b.data
Buffer comparisons seemed to work in one simple case - can someone tell me if it works at all?
Unfortunately, this does not work for overlapping fragments, and I did not understand how to extract from the buffer exactly what its offset is in the base data - maybe someone can help me?
Also, say a and b are slices x , and c is slices b . Since the underlying data is the same, I would also like to detect overlaps between c and a . It would seem that I should get away from comparing only the buffer and the form ... if someone could tell me exactly how I would appreciate it.
python numpy
shaunc May 25 '12 at 2:30 a.m. 2012-05-25 02:30
source share