📜  排序特征值和特征向量python代码示例

📅  最后修改于: 2022-03-11 14:45:35.823000             🧑  作者: Mango

代码示例1
import numpy as np
import numpy.linalg as linalg

A = np.random.random((3,3))
eigenValues, eigenVectors = linalg.eig(A)

idx = eigenValues.argsort()[::-1]   
eigenValues = eigenValues[idx]
eigenVectors = eigenVectors[:,idx]