numpy.geterr()
[source]
Get the current way of handling floating-point errors.
Returns: |
|
---|
See also
For complete documentation of the types of floating-point exceptions and treatment options, see seterr
.
>>> from collections import OrderedDict >>> sorted(np.geterr().items()) [('divide', 'warn'), ('invalid', 'warn'), ('over', 'warn'), ('under', 'ignore')] >>> np.arange(3.) / np.arange(3.) array([nan, 1., 1.])
>>> oldsettings = np.seterr(all='warn', over='raise') >>> OrderedDict(sorted(np.geterr().items())) OrderedDict([('divide', 'warn'), ('invalid', 'warn'), ('over', 'raise'), ('under', 'warn')]) >>> np.arange(3.) / np.arange(3.) array([nan, 1., 1.])
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.geterr.html