June 2015
Beginner
348 pages
8h 44m
English
Let's check whether one array is strictly greater than another array:
assert_array_less() function with two strictly ordered arrays:print("Pass", np.testing.assert_array_less([0, 0.123456789, np.nan], [1, 0.23456780, np.nan]))The result is as follows:
Pass None
assert_array_less() function:print("Fail", np.testing.assert_array_less([0, 0.123456789, np.nan], [0, 0.123456780, np.nan]))The test raises an exception:
Fail Traceback (most recent call last): ... raise AssertionError(msg) AssertionError: Arrays are not less-ordered (mismatch 100.0%) x: array([ 0. , 0.12345679, nan]) y: array([ 0. , 0.12345678, nan])
We checked the ordering of two arrays with the assert_array_less() ...
Read now
Unlock full access