{ } Raw JSON

bundles / numpy 2.4.4 / numpy / geterr

function

numpy:geterr

source: /numpy/_core/_ufunc_config.py :111

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.

Concurrency note: see /reference/routines.err

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