O'Reilly logo

Python Data Analysis by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding eigenvalues and eigenvectors with NumPy

Eigenvalues are scalar solutions to the equation Ax = ax, where A is a two-dimensional matrix and x is a one-dimensional vector. Eigenvectors are vectors corresponding to eigenvalues.

Note

Eigenvalues and eigenvectors are fundamental in mathematics and are used in many important algorithms, such as Principal Component Analysis (PCA). PCA can be used to simplify the analysis of large datasets.

The eigvals() subroutine in the numpy.linalg package computes eigenvalues. The eig() function gives back a tuple holding eigenvalues and eigenvectors.

We will obtain the eigenvalues and eigenvectors of a matrix with the eigvals() and eig() functions of the numpy.linalg subpackage. We will check the outcome by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required