What does the following error:
Warning: overflow encountered in exp
in scipy/numpy using Python generally mean? I\'m computing a ratio in log
In your case, it means that b
is very small somewhere in your array, and you're getting a number (a/b
or exp(log(a) - log(b))
) that is too large for whatever dtype (float32, float64, etc) the array you're using to store the output is.
Numpy can be configured to
See numpy.seterr to control how it handles having under/overflows, etc in floating point arrays.