bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / isfortran
function
numpy:isfortran
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/_core/numeric.py :553
Signature
def isfortran ( a ) Summary
Check if the array is Fortran contiguous but not C contiguous.
Extended Summary
This function is obsolete. If you only want to check if an array is Fortran contiguous use a.flags.f_contiguous instead.
Parameters
a: ndarrayInput array.
Returns
isfortran: boolReturns True if the array is Fortran contiguous but not C contiguous.
Examples
np.array allows to specify whether the array is written in C-contiguous order (last index varies the fastest), or FORTRAN-contiguous order in memory (first index varies the fastest).import numpy as np a = np.array([[1, 2, 3], [4, 5, 6]], order='C') a np.isfortran(a)✓
b = np.array([[1, 2, 3], [4, 5, 6]], order='F') b np.isfortran(b)✓
a = np.array([[1, 2, 3], [4, 5, 6]], order='C') a np.isfortran(a) b = a.T b np.isfortran(b)✓
np.isfortran(np.array([1, 2], order='F'))
✓Aliases
-
numpy.isfortran