The Wayback Machine - https://web.archive.org/web/20230512160725/https://www.geeksforgeeks.org/python-numpy-np-eigvals-method/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Python | Numpy np.eigvals() method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

With the help of np.eigvals() method, we can get the eigen values of a matrix by using np.eigvals() method.

Syntax : np.eigvals(matrix)
Return : Return the eigen values of a matrix.

Example #1 :
In this example we can see that by using np.eigvals() method, we are able to get the eigen values of a matrix by using this method.




# import numpy
from numpy import linalg as LA
  
# using np.eigvals() method
gfg = LA.eigvals([[1, 2], [3, 4]])
  
print(gfg)

Output :

[-0.37228132 5.37228132]

Example #2 :




# import numpy
from numpy import linalg as LA
  
# using np.eigvals() method
gfg = LA.eigvals([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
  
print(gfg)

Output :

[ 1.61168440e+01 -1.11684397e+00 -1.30367773e-15]

My Personal Notes arrow_drop_up
Last Updated : 03 Nov, 2019
Like Article
Save Article
Similar Reads
Related Tutorials