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

David Cournapeau cournape@gmail....
Sat Oct 31 07:58:53 CDT 2009


On Sat, Oct 31, 2009 at 9:45 PM, Chris Colbert <sccolbert@gmail.com> wrote:

> Graphically can this every occur in hardware memory:
>
> |--- a portion of array A ---|--- python object foo ---|--- The rest
> of array A ----|

No, this can never happen in the current numpy memory model, the
allocated block has to be contiguous, and you can get to any item of
the array from the data pointer (address of the first item) by N *
item_size. That's a fundamental feature to enable fast access (you
only need to jump once).

David


More information about the NumPy-Discussion mailing list