Equal arrays
The
assert_array_equal
function raises an exception if two arrays are not equal. The shapes of the arrays have to be equal and the elements of each array must be equal. NaNs
are allowed in the arrays. Alternatively, arrays can be compared with the array_allclose
function. This function has the parameters atol
(absolute tolerance) and rtol
(relative tolerance). For two arrays a
and b
, these parameters satisfy the equation:
|a - b| <= (atol + rtol * |b|)