numpy.testing.assert_array_equal()

numpy.testing.assert_array_equal

numpy.testing.assert_array_equal(x, y, err_msg='', verbose=True) [source]

Raises an AssertionError if two array_like objects are not equal.

Given two array_like objects, check that the shape is equal and all elements of these objects are equal. An exception is raised at shape mismatch or conflicting values. In contrast to the standard usage in numpy, NaNs are compared like numbers, no assertion is raised if both objects have NaNs in the same positions.

The usual caution for verifying equality with floating point numbers is advised.

登录查看完整内容