numpy.asfortranarray — NumPy v1.15 Manual (original) (raw)
numpy. asfortranarray(a, dtype=None)[source]¶
Return an array laid out in Fortran order in memory.
| Parameters: | a : array_like Input array. dtype : str or dtype object, optional By default, the data-type is inferred from the input data. |
|---|---|
| Returns: | out : ndarray The input a in Fortran, or column-major, order. |
See also
Convert input to a contiguous (C order) array.
Convert input to an ndarray with either row or column-major memory order.
Return an ndarray that satisfies requirements.
Information about the memory layout of the array.
Examples
x = np.arange(6).reshape(2,3) y = np.asfortranarray(x) x.flags['F_CONTIGUOUS'] False y.flags['F_CONTIGUOUS'] True