Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: testing.assert_array_equal: distinguish from assert_equal #24875

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions numpy/testing/_private/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,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
Loading