这是我的两个向量-:
y1=[2,3,4,5,6,7]
y2=[1,5,3,6,7,8]
当我用笔和纸解决时!它给了我一个ans-:y1= 1.117y2
当我在python中执行此操作时>
import numpy as np from numpy import linalg as LA A = np.array([y1,y2]) w, v = LA.eig(A) print(w) print(v)
发生此错误
LinAlgError: Last 2 dimensions of the array must be square
我该如何解决这个问题!
请帮助我,我该怎么做!
这是我的两个向量-:y1 = [2,3,4,5,6,7] y2 = [1,5,3,6,7,8]当我用纸和笔求解时!它给了我一个ans-:y1 = 1.117y2,当我在python中将numpy导入为numpy时,从numpy import ...
这里的问题是特征值只能存在于平方矩阵中,因此Numpy希望看到一个n x n维的矩阵,而不是上面的y1和y2这样的n x m维的向量。