numpy.asfortranarray(a, dtype=None)
[source]
Return an array (ndim >= 1) laid out in Fortran order in memory.
Parameters: |
|
---|---|
Returns: |
|
See also
ascontiguousarray
asanyarray
require
ndarray.flags
>>> x = np.arange(6).reshape(2,3) >>> y = np.asfortranarray(x) >>> x.flags['F_CONTIGUOUS'] False >>> y.flags['F_CONTIGUOUS'] True
Note: This function returns an array with at least one-dimension (1-d) so it will not preserve 0-d arrays.
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.asfortranarray.html