Tsallaka zuwa abun ciki
Justice Tech School

Eigenvalues

linalg.eig finds eigenvalues and eigenvectors of a square matrix.

Example
a = np.array([[2.0, 0.0], [0.0, 3.0]])
vals, vecs = np.linalg.eig(a)
print(vals)
print(vecs)

Result

[2.+0.j 3.+0.j]
[[1.+0.j 0.+0.j]
 [0.+0.j 1.+0.j]]

Exercise

Eigen function.

np.linalg.(a)

Quiz Test

What does eig return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.