[Numpy-discussion] Traceback on divide by zero error

Tony S Yu tonyyu@MIT....
Thu Dec 13 13:41:31 CST 2007


On Dec 13, 2007, at 2:21 PM, Robert Kern wrote:

> Tony S Yu wrote:
>> Hello,
>>
>> This is something that's been bothering for awhile. When numpy raises
>> the following divide by zero error:
>>>>> Warning: divide by zero encountered in double_scalars
>> is there a way to get a Traceback on where that warning occurred.
>
> In [1]: from numpy import *
> In [3]: seterr(divide='raise')

seterr(divide='warn') is exactly what I was looking for.

Thanks!
-Tony


More information about the Numpy-discussion mailing list