This is documentation for an old release of NumPy (version 1.6.0). Read this page in the documentation of the latest stable release (version > 1.17).
Raise an assertion if two objects are not equal.
Given two objects (scalars, lists, tuples, dictionaries or numpy arrays), check that all elements of these objects are equal. An exception is raised at the first conflicting values.
Parameters : | actual : array_like
desired : array_like
err_msg : str, optional
verbose : bool, optional
|
---|---|
Raises : | AssertionError :
|
Examples
>>> np.testing.assert_equal([4,5], [4,6])
...
<type 'exceptions.AssertionError'>:
Items are not equal:
item=1
ACTUAL: 5
DESIRED: 6