V
V
Viva88882022-04-07 15:04:14
Python
Viva8888, 2022-04-07 15:04:14

How to write trace code without loops and generators?

I have following code. Is it necessary that there are no cycles and generators in the code, i.e. you need to get the matrix A in some other way? is there any ready-made function in numpy? Thanks in advance

matrix_A = ones
print(matrix_A)
for i in range(1, 23):
    matrix_A = np.concatenate((matrix_A, X_train ** i), axis=1)
poly_coef = sla.solve(matrix_A, Y_train)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-04-07
@Vindicar

If I correctly understood the problem being solved, then polyfit ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question