Reputation: 1733
I am using Numpy/Scipy to invert a 20k matrix, it's slow. I tried:
(1) M_inv = M.I
(2) Ident = np.Identity(len(M))
M_inv = scipy.linalg.solve(M, Ident)
(3) M_inv = scipy.linglg.inv(M)
but didn't see any speedup.
Is there any other way to speed this up?
Upvotes: 4
Views: 4288
Reputation: 28856
This is a big matrix, and inverting it is going to be slow. Some options:
scipy.linalg.sparse
. (This will probably be slower if there are only a few zeros, though.)Upvotes: 8