Eigenvectors in Numpy

How do I properly obtain the eigenvectors with Numpy?

import numpy as np

A = np.array([[9, 4], [4, 3]])
print(“Matrix is :”,A)

print("Eigenvalues: ", np.linalg.eigvals(A))

eigenvalue, eigenvector = np.linalg.eig(A)

print("E-value: ", eigenvalue)
print("E-vector: ", eigenvector)

The code above will give the results:
E-value: [11. 1.]
E-vector: [[ 0.89442719 -0.4472136 ]
[ 0.4472136 0.89442719]]

While if I do the calculations manually I obtain:
[2 1] and [-1 2]

What am I doing wrong?

Hi @rfpr. Welcome to DeepLearning community!

What you did is correct. Those two eigenvectors are equivalent because:

0.4472136 * 2 = 0.8944272

Note that there can be an infinite number of eigenvectors for a given eigenvalue. That is because you can multiply any scalar to the eigenvector and it is still the equivalent eigenvector. In practice, we just take the simplest form (values with 0 or 1) that we can use for eigenbases.

thank you @jonrico I’ll review those concepts again.