I'm converting SAS code into Python and I've noticed a difference between the results of a SAS procedure and its Python equivalent. For example : The SAS code : proc iml; abc = {1 2 3 1, 4 5 6 1, 7 8 9 1, 1 1 1 1}; /* Calculation of eigenvalues (eigm) and eigenvectors (eigv) */ eigm = eigval(abc); eigv = eigvec(abc); print eigm, eigv; quit; the result : The Python equivalent of this SAS code : import numpy as np # Definition of matrix abc abc = np.array([[1, 2, 3, 1], [4, 5, 6, 1], [7, 8, 9, 1], [1, 1, 1, 1]]) # Calculation of eigenvalues and eigenvectors eigenvalues, eigenvectors = np.linalg.eig(abc) print("Eigenvalues :", eigenvalues) print("Eigenvectors :\n", eigenvectors) Remarks: It's easy to see that the values are the same in both sets of results, but they don't follow the same layout.
... View more