Storage compatibility requirements

Only when a has Fortran (column major) storage, the Fortran function works on a itself
If we provide a plain NumPy array, it has C (row major) storage, and the wrapper sends a copy to the Fortran function and transparently transposes the result
Hence, F2PY is very user-friendly, at a cost of some extra memory
The array returned from F2PY has Fortran (column major) storage

previousnexttable of contents