Skip to content

Commit a13d26f

Browse files
authored
Add files via upload
1 parent 07b6822 commit a13d26f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

eigenvalues_and_eigenvectors.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"@Author: @learn.machinelearning"
2+
3+
import numpy as np
4+
from numpy.linalg import eig
5+
6+
# Python code for eigen decomposition
7+
# Theory https://www.instagram.com/p/BtFVWoxnbYi/
8+
matrix_A = np.array([[4, -1, 9, 3], [13, 5, 12, 8], [4, 3, 8, 12], [7, 13, 8, 12]])
9+
result = eig(matrix_A)
10+
eigen_values = result[0]
11+
eigen_vectors = result[1]
12+
print("Result of {} = {}, {}".format(matrix_A, eigen_values, eigen_vectors))
13+

0 commit comments

Comments
 (0)