Skip to content

Commit

Permalink
Merge pull request #24875 from mdhaber/gh8457
Browse files Browse the repository at this point in the history
DOC: testing.assert_array_equal: distinguish from assert_equal
  • Loading branch information
rgommers committed Oct 14, 2023
2 parents 59a938c + 038a981 commit dbd30ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions numpy/testing/_private/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,16 @@ def assert_array_equal(x, y, err_msg='', verbose=True, *, strict=False):
The usual caution for verifying equality with floating point numbers is
advised.
.. note:: When either `x` or `y` is already an instance of `numpy.ndarray`
and `y` is not a ``dict``, the behavior of ``assert_equal(x, y)`` is
identical to the behavior of this function. Otherwise, this function
performs `np.asanyarray` on the inputs before comparison, whereas
`assert_equal` defines special comparison rules for common Python
types. For example, only `assert_equal` can be used to compare nested
Python lists. In new code, consider using only `assert_equal`,
explicitly converting either `x` or `y` to arrays if the behavior of
`assert_array_equal` is desired.
Parameters
----------
x : array_like
Expand Down

0 comments on commit dbd30ce

Please sign in to comment.