allclose(a, b, masked_equal=True, rtol=1e-05, atol=1e-08)
This function is equivalent to allclose
except that masked values are treated as equal (default) or unequal, depending on the masked_equal
argument.
If the following equation is element-wise True, then allclose
returns True:
absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))
Return True if all elements of a
and b
are equal subject to given tolerances.
Input arrays to compare.
Whether masked values in a
and b
are considered equal (True) or not (False). They are considered equal by default.
Relative tolerance. The relative difference is equal to rtol * b
. Default is 1e-5.
Absolute tolerance. The absolute difference is equal to :None:None:`atol`
. Default is 1e-8.
Returns True if the two arrays are equal within the given tolerance, False otherwise. If either array contains NaN, then False is returned.
Returns True if two arrays are element-wise equal within a tolerance.
numpy.allclose
the non-masked :None:None:`allclose`
.
>>> a = np.ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])This example is valid syntax, but we were not able to check execution
... a masked_array(data=[10000000000.0, 1e-07, --], mask=[False, False, True], fill_value=1e+20)
>>> b = np.ma.array([1e10, 1e-8, -42.0], mask=[0, 0, 1])This example is valid syntax, but we were not able to check execution
... np.ma.allclose(a, b) False
>>> a = np.ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])This example is valid syntax, but we were not able to check execution
... b = np.ma.array([1.00001e10, 1e-9, -42.0], mask=[0, 0, 1])
... np.ma.allclose(a, b) True
>>> np.ma.allclose(a, b, masked_equal=False) False
Masked values are not compared directly.
This example is valid syntax, but we were not able to check execution>>> a = np.ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])This example is valid syntax, but we were not able to check execution
... b = np.ma.array([1.00001e10, 1e-9, 42.0], mask=[0, 0, 1])
... np.ma.allclose(a, b) True
>>> np.ma.allclose(a, b, masked_equal=False) FalseSee :
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.ma.core.allequal
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