[Numpy-discussion] just how 'discontiguous' can a numpy array become?

Chris Colbert sccolbert@gmail....
Sat Oct 31 07:22:47 CDT 2009


For example say we have an original array  a=np.random.random((512, 512, 3))
and we take a slice of that array b=a[:100, :100, :]

now, b is discontiguous, but all if its memory is owned by a.

Will there ever be a situation where a discontiguous array owns its
own data? Or more generally, will discontiguous data alway have a
contiguous parent?

As far as i understand the numpy strided model, that could only be
supported if len(strides) = ndim+1, I dont think numpy supports that.

Don't get me wrong, I'm not making a feature request, just making sure
I fully understand the array model so I can avoid trampling on memory.

Cheers!

Chris


More information about the NumPy-Discussion mailing list