I have a moderately large portion (several thousand lines) of Python / Numpy / Scipy code that throws NaN with specific inputs. I searched and found some of the usual suspects ( log(0) , etc.), but none of the obvious ones seem to be the culprit in this case.
Is there a relatively painless way (for example, besides entering an exception handling code for each potential culprit) to find out where these NaN come from?
python debugging numpy scipy nan
Chinmay kanchi
source share