To write a python program to find the Eigen Values and Eigen Vectors
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
Import the library numpy using the import command.
Assigning a matrix to a variable.
Using the np.linalg.eig(), we get two results (first is eigenvalue and second is eigenvector) of the given matrix.
Print the eigen values and eigen vectors of the matrix and end the program.
#Program to find the eigen values and eigen vectors.
#Developed by: NAVIN KUMAR J
#RegisterNumber:22009212
import numpy as np
a=np.array([[-2,2,-3],[2,1,-6],[-1,-2,0]])
values,vector=np.linalg.eig(a)
print("Eigen values are",values,"and Eigen Vectors are",vector)
Thus the Eigenvalues and Eigenvectors are successfully solved using python program