Example.

In [18]:a = array([1,2,3])

In [19]:a.flags
Out[19]:
 C_CONTIGUOUS : True
 F_CONTIGUOUS : True
 OWNDATA : True
 WRITEABLE : True
 ALIGNED : True
 UPDATEIFCOPY : False

In [20]:a.shape = (1,3)

In [21]:a.flags
Out[21]:
 C_CONTIGUOUS : True
 F_CONTIGUOUS : False
 OWNDATA : True
 WRITEABLE : True
 ALIGNED : True
 UPDATEIFCOPY : False

In [22]:a.shape = (3,1)

In [23]:a.flags
Out[23]:
 C_CONTIGUOUS : True
 F_CONTIGUOUS : False
 OWNDATA : True
 WRITEABLE : True
 ALIGNED : True
 UPDATEIFCOPY : False

All three shapes are both C_CONTIGUOUS and F_CONTIGUOUS. I think ignoring
all 1's in the shape would give the right results  for otherwise contiguous
arrays because in those positions the index can only take the value 0.


Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to