In Matlab, using the inv() function is often discouraged due to numerical instability (see description section in http://www.mathworks.com/help/matlab/ref/inv.html). It is suggested to replace an expression like:
inv(A)*B
(where both A and B are matrices), with:
A\B
This becomes critical when the inverted matrix A is close to singular.
Is there a nice way to write this in numpy / scipy? (would solve() work?)