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 equations and assign in np.array()
Using the np.linalg.eig(), we get two results (first is eigenvalue and second is eigenvector) of the given matrix.
End the program
#Program to find the eigen values and eigen vectors.
#Developed by: LAVANYA S
#RegisterNumber:212223230112
import numpy as np
matrix=np.array([[2,-3,0],[2,-5,0],[0,0,3]])
eigenvalues,eigenvectors= np.linalg.eig(matrix)
print("Eigen values are",eigenvalues,"and Eigen Vectors are",eigenvectors)
Thus the Eigenvalue and Eigenvector is successfully solved using python program