[Numpy-discussion] newaxis and contiguity

David Cournapeau david@ar.media.kyoto-u.ac...
Fri Oct 31 01:51:04 CDT 2008


Hi,

    I was wondering about the following behavior:

a = np.random.randn(10)
b = a[:. np.newaxis]
print b.flags # F_CONTIGUOUS and C_CONTIGUOUS are both false

Is it for simplicity purpose, or is there a more fundamental reason why
a rank 2, 'column' vector can't be F_CONTIGUOUS in this case ? Does the
operation involving newaxis modifies the data buffer ?

thanks,

David


More information about the Numpy-discussion mailing list