【scipy】scipy.linalg.det 计算矩阵的行列式 python
·
scipy.linalg.det(),计算矩阵的行列式
例:对3x3的矩阵的行列式计算如下
[abcdefghi]=A\left[
\begin{matrix}
a & b & c \\
d & e & f \\
g & h & i
\end{matrix}
\right]
=A⎣⎡adgbehcfi⎦⎤=A
det(A)=a∗e∗i+b∗f∗g+c∗d∗h−c∗e∗g−b∗d∗i−a∗f∗hdet(A) = a*e*i + b*f*g + c*d*h - c*e*g - b*d*i - a*f*hdet(A)=a∗e∗i+b∗f∗g+c∗d∗h−c∗e∗g−b∗d∗i−a∗f∗h
实例:
[123456789]=?
\left[
\begin{matrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{matrix}
\right]
=?⎣⎡147258369⎦⎤=?
程序,如下
import numpy as np
from scipy import linalg
a = np.array([[1,2,3], [4,5,6], [7,8,9]])
print(linalg.det(a))
结果
0.0
更多推荐



所有评论(0)