线性代数矩阵转置乘法
Prerequisites:
先决条件:
In linear algebra, the identity matrix, of size n is the n × n square matrix with ones on the main diagonal and zeros elsewhere. It is denoted by I. Also known as the unit matrix because its determinant value is 1 irrespective of size. This is the key feature of an Identity matrix and it plays an important role in Linear Algebra.
在线性代数中,大小为n的单位矩阵是n×n方阵,主对角线上为1,其他地方为零。 用I表示。 也称为单位矩阵,因为其行列式值为1,与大小无关。 这是恒等矩阵的关键特征,在线性代数中起着重要的作用。
The identity matrix has the property that, transpose of identity matrix gives identity matrix (IT = I).
单位矩阵具有的特性是,单位矩阵的转置给出单位矩阵( I T = I )。
Method 1:
方法1:
Syntax:
M = numpy.eye(n)
transpose_M = M.T
Parameter:
dimension of the matrix n
Return:
MT
Method 2:
方法2:
Syntax:
M = numpy.eye(n)
transpose_M = numpy.transpose(M)
Input Parameter:
dimension of the matrix n
Return:
MT
身份矩阵转置属性的Python代码 (Python code for identity matrix transpose property)
# Linear Algebra Learning Sequence
# Transpose using different Method
import numpy as np
I = np.eye(4)
print("---Matrix I---\n", I)
# Transposing the Matrix g
print('\n\nTranspose as I.T----\n', I.T)
print('\n\nTranspose as np.tanspose(I)----\n', np.transpose(I))
if I.T.all() == I.all():
print("Transpose is eqaul to I")
Output:
输出:
---Matrix I---
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 1.]]
Transpose as I.T----
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 1.]]
Transpose as np.tanspose(I)----
[[1. 0. 0. 0.]
[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 1.]]
Transpose is eqaul to I
翻译自: https://www.includehelp.com/python/identity-matrix-transpose-property.aspx
线性代数矩阵转置乘法