This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / 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 : dict

A 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