bundles / numpy latest / numpy / geterr
function
numpy:geterr
source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/_core/_ufunc_config.py :108
Signature
def geterr ( ) Summary
Get the current way of handling floating-point errors.
Returns
res: dictA dictionary with keys "divide", "over", "under", and "invalid", whose values are from the strings "ignore", "print", "log", "warn", "raise", and "call". The keys represent possible floating-point exceptions, and the values define how these exceptions are handled.
Notes
For complete documentation of the types of floating-point exceptions and treatment options, see seterr.
Examples
import numpy as np np.geterr()✓
oldsettings = np.seterr(all='warn', invalid='raise') np.geterr() np.arange(3.) / np.arange(3.) oldsettings = np.seterr(**oldsettings) # restore original✓
See also
- geterrcall
- seterr
- seterrcall
Aliases
-
numpy.geterr