【发布时间】:2021-03-22 01:15:54
【问题描述】:
我正在同时学习物理和 numpy。 Numpy 说我的 3x3 矩阵有 2 维,但在我的物理书或 3blue1brown“线性代数的本质”中,3x3 矩阵是 3-D
#a '2d' array, created using identity
i2d = np.identity(3)
print(i2d)
print('this is a %s-D array, shape is %s with %s elements'%(i2d.ndim, i2d.shape, i2d.size))
YIELDS:
[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]
this is a 2-D array, shape is (3, 3) with 9 elements
在线性代数中,这定义了一个具有 3 个垂直基向量的 3-D 空间。任何人都知道我错过了什么。
【问题讨论】:
-
一个矩阵可以表示n维空间中任意n的线性变换,或从n维空间中抽取的一组数据点,但矩阵本身的维数是另一回事。
标签: python arrays numpy numpy-ndarray