身份矩阵的决定因素| 使用Python的线性代数

Prerequisites:

先决条件:

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|. The identity matrices have determinant one and this is one of the properties of the identity matrix. Using python library function, we will try to find the determinant of identity matrices.

在线性代数中,行列式是可以为方矩阵计算的标量值,代表矩阵的某些属性。 矩阵A的行列式表示为det(A)det A| A |。 。 单位矩阵具有行列式1,这是单位矩阵的特性之一。 使用python库函数,我们将尝试查找身份矩阵的行列式。

用于演示身份矩阵行列式的Python代码 (Python code for demonstrating the determinant of identity matrix)

# Linear Algebra Learning Sequence
# Determinant of Identity Matrix

import numpy as np

print(np.eye(4))
det_M = np.linalg.det(np.eye(4))
print("Determinant : ", det_M)

print("\n\n", np.eye(7))
det_M = np.linalg.det(np.eye(7))
print("Determinant : ", det_M)

Output:

输出:

[[1. 0. 0. 0.]
 [0. 1. 0. 0.]
 [0. 0. 1. 0.]
 [0. 0. 0. 1.]]
Determinant :  1.0


 [[1. 0. 0. 0. 0. 0. 0.]
 [0. 1. 0. 0. 0. 0. 0.]
 [0. 0. 1. 0. 0. 0. 0.]
 [0. 0. 0. 1. 0. 0. 0.]
 [0. 0. 0. 0. 1. 0. 0.]
 [0. 0. 0. 0. 0. 1. 0.]
 [0. 0. 0. 0. 0. 0. 1.]]
Determinant :  1.0


翻译自: https://www.includehelp.com/python/determinant-of-identity-matrix.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值