线性代数矩阵行列式_矩阵的行列式 使用Python的线性代数
线性代数矩阵行列式
In linear algebra, the determinant is a scalar value that can be computed for a square matrix and represents certain properties of the matrix. The determinant of a matrix A is denoted det(A) or det A or |A|. Python library numpy provides a wide range of functions that can be used to manipulate matrices. One of such functions is numpy.linalg.det(A), which allows us to directly return the value of the determinant of a matrix A.
在线性代数中, 行列式是可以为方矩阵计算的标量值,代表矩阵的某些属性。 矩阵A的行列式表示为det(A)或det A或| A |。 。 Python库numpy提供了广泛的函数,可用于处理矩阵。 numpy.linalg.det(A)是此类函数之一 ,它使我们可以直接返回矩阵A的行列式的值。
Following is a python code for demonstrating how to use numpy.linalg.det(A)
以下是用于演示如何使用numpy.linalg.det(A)的python代码
用于演示如何使用numpy.linalg.det(A)的Python代码? (Python code for demonstrating how to use numpy.linalg.det(A)?)
# Linear Algebra Learning Sequence
# Finding determinant
import numpy as np
M = np.array([[2,3,4], [3,45,8], [4,8,78]])
print("---Matrix A---\n", M)
det_A = np.linalg.det(M)
print("The determinant of matrix A : ", det_A)
M = np.array([[2,3,4], [3,14,8], [14,8,7]])
print("\n\n---Matrix B---\n", M)
det_B = np.linalg.det(M)
print("The determinant of matrix B : ", det_B)
Output:
输出:
---Matrix A---
[[ 2 3 4]
[ 3 45 8]
[ 4 8 78]]
The determinant of matrix A : 5661.9999999999945
---Matrix B---
[[ 2 3 4]
[ 3 14 8]
[14 8 7]]
The determinant of matrix B : -347.00000000000006
翻译自: https://www.includehelp.com/python/determinant-of-a-matrix.aspx
线性代数矩阵行列式