[Numpy-discussion] Response to PEP suggestions

Stephen Walton stephen.walton at csun.edu
Thu Feb 17 14:27:16 EST 2005


Fernando Perez wrote:

> It would be nice for .flat to be a guaranteed, indexable, no-copy view 
> of the original (even if it's non-contiguous).

Dare I point out that a.flat works for non-contiguous arrays in numarray?

In [4]: a.iscontiguous()
Out[4]: 0

In [5]: a.flat
Out[5]:
array([ 0,  5, 10, 15, 20,  1,  6, 11, 16, 21,  2,  7, 12, 17, 22,  3,
        8, 13, 18, 23,  4,  9, 14, 19, 24])






More information about the NumPy-Discussion mailing list