我在这里有一些代码:
u = np.zeros((4, 1))
U = np.zeros((4, 4))
# Then did some stuff to change some value in U
X = U * u
print U
print u
print X
输出:
[[ 0. -1. 2. 0.]
[ 0. 0. -1. 3.]
[ 0. 0. 0. -1.]
[ 0. 0. 0. 0.]]
[[ 0.]
[ 0.]
[ 0.]
[ 0.]]
[[ 0. -0. 0. 0.]
[ 0. 0. -0. 0.]
[ 0. 0. 0. -0.]
[ 0. 0. 0. 0.]]
我无法弄清楚。 X不应该是4 * 1矩阵吗?为什么是4 * 4?