To write a python program to find the Eigenvalues and Eigen Vectors
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
Import the numpy module to use the built-in functions for calculation
Prepare the lists from each linear equations and assign in np.array()
Using the np.linalg.matrix_rank(), we can find the rank of the given matrix.
End the program
import numpy as np
A = np.array([[4, 2],
[2, 4]])
eigenvalues, eigenvectors = np.linalg.eig(A)
print("Eigen values are", eigenvalues, "and Eigen Vectors are", eigenvectors)
Thus the Eigenvalue and Eigenvector is successfully solved using python program