Python, Machine Learning, Statistics, Data Science, Technology.
Sort eigenvalues in descending order: # Make a set of (eigenvalue, eigenvector) pairs: eig_pairs = [(eigenvalues[index], eigenvectors[:,index]) for index in range(len(eigenvalues))] # Sort the (eigenvalue, eigenvector) pairs from highest to lowest with respect to eigenvalue eig_pairs.sort()