Created
August 11, 2020 15:34
-
-
Save davixcky/0dae6fde17bfd216af5beb0be858eba7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def get_column(matrix, column=0): | |
values = [] | |
for row in matrix: | |
values.append(row[column]) | |
return values | |
tabla_1 = [ | |
[70, 0], | |
[57, 8], | |
[60, 7.5], | |
[63, 13.5], | |
[57, 14], | |
[66, 8.5], | |
[67, 4.5], | |
[107, -11], | |
[96, -7.5], | |
[88, -8.5], | |
[80, 1.5], | |
[64, 0.5], | |
[79, 2], | |
[82, -6], | |
[97, -4] | |
] | |
x = get_column(tabla_1, 1) | |
y = get_column(tabla_1) | |
coeficientes = np.ones(len(tabla_1), dtype="int") | |
tabla_tmp = list(map(lambda x, y: [y, x], x, coeficientes)) | |
tabla_tmp = np.matrix(tabla_tmp) | |
print(len(tabla_tmp)) | |
print(np.dot(tabla_tmp, tabla_tmp.T)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment