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 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion