[SciPy-User] F_CONTIGUOUS and C_CONTIGUOUS

Ramon Crehuet rcsqtc@iqac.csic...
Fri Jan 29 06:00:55 CST 2010


Hi all,
I have some doubts about the meaning of F_CONTIGUOUS and C_CONTIGUOUS.I thought
thay refered to storing matrices "in rows" or "in columns", but...  Imagine 2
arrays:
y=np.zeros((10000, 10))
y2=np.zeros((10000, 10), order='F')

I can understand the y.flags and y2.flags, however I would expect y[0,:].flags
to be F_CONTIGUOUS False, because it is the last index which is changing. And
y[:,0].flags to be C_CONTIGUOUS False, because this is a column of that matrix.
I am wrong in boths.

Similarly, I don'y understand why:
In [114]: y2[:,0].flags
Out[114]:
  C_CONTIGUOUS : True
  F_CONTIGUOUS : True

and:
In [113]: y2[0,:].flags
Out[113]:
  C_CONTIGUOUS : False
  F_CONTIGUOUS : False

So I guess I have some deep minunderstanding about the meaning of this flags and
I would appreciate some enlightening.
Thanks!
Ramon



More information about the SciPy-User mailing list