Numpy.linalg.det
numpy.linalg.
det
(a)[source]
Computes the determinant of any array a, but this requires that the last two dimensions of the array must be square.
Parameters: |
a : (....., M, m) array_like
Input array to compute determinants for.
|
Return: |
det : (...) Array_like
Determinant of a.
|
For example:
1>>>a=np.reshape (Np.arange (6), (2,3))2>>>a3Out:array ([[[0, 1, 2],4[3, 4, 5]])5>>>Np.linalg.det (a)6Out:LinAlgError:Last 2dimensions of the array must be square7 8>>>a=np.reshape (Np.arange (20), (5,2,2))9>>>aTenOut:array ([[[[[0], 1], One[2, 3]], A -[[4, 5], -[6, 7]], the -[[8, 9], -[10, 11]], - +[[12, 13], -[14, 15]], + A[[16, 17], at[18, 19]]]) - ->>>Np.linalg.det (a) -Out:array ([-2.,-2.,-2.,-2.,-2.])
In fact, this function is to calculate the determinant value of a square matrix.
NumPy the determinant of an array in Python Numpy.linalg.det ()