On 2014-12-15 02:23:18, Julian Taylor <[email protected]> wrote:
> already exists as np.errstate:
>
> with np.errstate(divide='ignore'):

With 'ignore' a warning is still raised--is this by choice?

>>> import numpy as np
>>> x = np.array([0, 1, 2.])
>>> with np.errstate(divide='ignore'):
...     x/x
... 
__main__:2: RuntimeWarning: invalid value encountered in true_divide
array([ nan,   1.,   1.])


(I see it is documented that way as well, so I suspect so.)

Stéfan
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to