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

David Cournapeau cournape at gmail.com
Sat Oct 31 08:58:53 EDT 2009


On Sat, Oct 31, 2009 at 9:45 PM, Chris Colbert <sccolbert at 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