December 2017
Intermediate to advanced
386 pages
10h 42m
English
In SciPy, we calculate the eigenvector and eigenvalue of a given matrix by using the eig function in scipy.linalg.
Using the following code, let us look at calculating the eigenvector and the corresponding eigenvalue of a given matrix:
a = np.array([[1, 2], [3, 4]])
la, v = linalg.eig(a)
print(la)[-0.37228132+0.j 5.37228132+0.j]print(v)[[-0.82456484 -0.41597356] [ 0.56576746 -0.90937671]]
Note that la is the eigenvalue and the v matrix is the eigenvector.
Let us cross-check the preceding output based on the intuition we laid out at the start of this section.
The eigenvector for a given matrix A satisfies the ...
Read now
Unlock full access