> So my question is: how can one reliably detect singularity (or > near singularity) and raise an exception? Matrix condition number: http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.cond.html http://en.wikipedia.org/wiki/Condition_number Stuart