[Numpy-discussion] Managing Rolling Data

Travis Oliphant oliphant@ee.byu....
Wed Feb 21 13:59:27 CST 2007


Anne Archibald wrote:

>Discontiguous blocks are somewhat inconvenient; one of the key
>assumptions of numpy is that memory is stored in contiguous,
>homogeneous blocks. 
>

Not to add anything really useful to this discussion, but I should 
correct this wording before it gives incorrect conceptions.  Actually 
the key assumption NumPy makes is that memory is accessible through 
uniform "striding" and not that it is necessarily contiguous.   You are 
correct, however that each element of the array must be of the same 
"data-type."

>Incidentally, if the array wants to be inhomogeneous along one
>dimension, you can use recarrays (apparently; I've never investigated
>them).
>  
>

Your arrays are still "homogeneous" when you use record arrays (i.e. 
each element of the array is still the same "data-type")  It's just that 
the data-type can be complicated.  You can have arrays whose elements 
consist of a 4-byte float and a 3-byte string for example.

-Travis



More information about the Numpy-discussion mailing list