numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
seterrobj(errobj, /)

The error object contains all information that defines the error handling behavior in NumPy. seterrobj is used internally by the other functions that set error handling behavior (seterr , seterrcall ).

Notes

For complete documentation of the types of floating-point exceptions and treatment options, see seterr .

Parameters

errobj : list

The error object, a list containing three elements: [internal numpy buffer size, error mask, error callback function].

The error mask is a single integer that holds the treatment information on all four floating point errors. The information for each error type is contained in three bits of the integer. If we print it in base 8, we can see what treatment is set for "invalid", "under", "over", and "divide" (in that order). The printed string can be interpreted with

Set the object that defines floating-point error handling.

See Also

getbufsize
geterr
geterrcall
geterrobj
setbufsize
seterr
seterrcall

Examples

This example is valid syntax, but we were not able to check execution
>>> old_errobj = np.geterrobj()  # first get the defaults
... old_errobj [8192, 521, None]
This example is valid syntax, but we were not able to check execution
>>> def err_handler(type, flag):
...  print("Floating point error (%s), with flag %s" % (type, flag)) ...
This example is valid syntax, but we were not able to check execution
>>> new_errobj = [20000, 12, err_handler]
... np.seterrobj(new_errobj)
... np.base_repr(12, 8) # int for divide=4 ('print') and over=1 ('warn') '14'
This example is valid syntax, but we were not able to check execution
>>> np.geterr()
{'over': 'warn', 'divide': 'print', 'invalid': 'ignore', 'under': 'ignore'}
This example is valid syntax, but we were not able to check execution
>>> np.geterrcall() is err_handler
True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.geterrobj numpy.seterrobj

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : None#None
type: <class 'builtin_function_or_method'>
Commit: