I'm working on some linear algebra and using numpy for reference. I use lambda k: numpy.linalg.det(A - k*I) to compute the characteristic polynomial of a matrix A.
That works wonderfully, and the next step would be to calculate the roots of that polynomial which represents the eigenvalues of the matrix, using numpy.roots, the problem being that numpy.roots takes a polynomial coefficients as argument.
Is there any way to extract the coefficients from the lambda k?
(I am aware of the existence of numpy.linalg.eigvals but I would rather not use it.)