4 ms·
Compared to the library version: import numpy as np np.linalg.inv([[1,2],[3,4]]) and this does handle the case where the determinant is 0 (by throwing an
by PureParadigm 7y ago
Compared to the library version:
import numpy as np
np.linalg.inv([[1,2],[3,4]])
and this does handle the case where the determinant is 0 (by throwing an error about it being a singular matrix).
- xaedes 7y agoAvoid np.linalg.inv if you can do it in another way.. It slows the already slow python even more. Recently replaced np.linalg.inv by an affine transformation inverse (what was really needed) in one of our codebases to get a speedup of 100x.