It's means the array must be "C" contiguous (rows are contiguous). As
opposed to Fortran contiguous (mode="f") where the columns are
contiguous or unspecified. If you're able to specify the a mode you get
a gain in efficiency when indexing into the array because Cython doesn't
need to deal with the stride between some elements. However, your
function won't accept some array slices (for example).
Numpy arrays are C contiguous by default, but slicing or transposing
them may change that. Therefore mode="c" is good for "freshly allocated"
arrays but unhelpful for arrays that may be coming from unknown sources
with unknown manipulations.
I interpret this to mean that I could replace `mode='c'` by `mode='f'` for example, but when I do this my cythonizer spits out the error
Only allowed buffer modes are: "c", "fortran", "full", "strided" (as compile-time string).
This certainly sounds nearly as you describe, in that there are c and fortran options. But there are also full and strided options, I guess? This is also very close to what appears on the cython memoryviews page, except that I'm surprised that I can define this for an ndarray type. Is this documented somewhere?
I went from memory and it sounds like I was slightly wrong. Use "fortran" instead of "f". I think "strided" is the default - it can take arbitrary array slices. I'm not quite sure what "full" is; possibly it might be closer to "indirect" for memoryviews?
Memoryviews have largely the same purpose as the ndarray type (so
has similar features). The memoryview syntax is more modern and
has some advantages so the documentation focuses on that.
The "mode" for the older syntax doesn't look to be thoroughly
documented that I can see.