[Numpy-discussion] Context manager for seterr

Pauli Virtanen pav at iki.fi
Sun Dec 14 19:24:01 EST 2014


15.12.2014, 02:12, Stefan van der Walt kirjoitti:
> Since the topic of context managers recently came up, what do you think
> of adding a context manager for seterr?
> 
> with np.seterr(divide='ignore'):
>     frac = num / denom

There's this:

with np.errstate(divide='ignore'):
     ...






More information about the NumPy-Discussion mailing list