[Numpy-discussion] fiddling the strides of an array

A. M. Archibald peridot.faceted at gmail.com
Mon Nov 20 16:12:15 EST 2006


On 20/11/06, Tim Hochberg <tim.hochberg at ieee.org> wrote:

> I don't know how much help this will be, but, if the input array can be
> mapped into a contiguous array using transpose, which looks to be the
> case with at least one of the problematic cases you show here, you could
> transpose so as to get a contiguous array and grab the buffer from that.
> As for how to decide what transposes to do, while it sounds like a fun
> problem, I don't have time to delve into it right now.

I thought about that, actually, all you'd have to do is argsort the
strides tuple. It still fails for arrays that are of the form a[::2],
though, and I'm still hoping to find the secret code to access
something I know numpy is perfectly capable of doing, so I don't
really want to add such a grotty hack.

A. M. Archibald



More information about the NumPy-Discussion mailing list