Question: Whats wrong with this code? Error says ufunc isfinite not supported for the input types, and the inputs could not be safely coerced to any

Whats wrong with this code? Error says ufunc isfinite not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule safe
4.3[2pt What 22 matrix, with integer entries, has 10 and 25 as eigenvalues with eigenvectors 1,4 and 1,-1, respectively? Store it in the variable matrix_answer.
Hint: Put variables for entries in a 22 array ([a11,a12],[a21,a22]), write out the equations that must be satisfied, and solve for the entires.
import numpy as np
A=np.array([141-1])
vals=np.linalg.eigvals (A)
vecs=np.linalg.eig (A)
a11=vals
a12=vecs[][1]
a21=vecs [1][1]
a22=vals [1]
matrix_answer =np.array([a11a12a21a22])
print (matrix_answer)
 Whats wrong with this code? Error says ufunc isfinite not supported

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!