bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / linalg / det
_ArrayFunctionDispatcher
numpy.linalg:det
source: build-install/usr/lib/python3.14/site-packages/numpy/linalg/_linalg.py :2355
Signature
def det ( a ) Summary
Compute the determinant of an array.
Parameters
a: (..., M, M) array_likeInput array to compute determinants for.
Returns
det: (...) array_likeDeterminant of
a.
Notes
Broadcasting rules apply, see the numpy.linalg documentation for details.
The determinant is computed via LU factorization using the LAPACK routine z/dgetrf.
Examples
The determinant of a 2-D array [[a, b], [c, d]] is ad - bc:import numpy as np a = np.array([[1, 2], [3, 4]])✓
np.linalg.det(a)
✗a = np.array([ [[1, 2], [3, 4]], [[1, 2], [2, 1]], [[1, 3], [3, 1]] ]) a.shape np.linalg.det(a)✓
See also
- scipy.linalg.det
Similar function in SciPy.
- slogdet
Another way to represent the determinant, more suitable for large matrices where underflow/overflow may occur.
Aliases
-
numpy.linalg.det