'Replacing np.all comparison with assert_allclose()
I am working on the code correction of a unit test. The output from the usage of np.all() is not up to the mark in comparison to assert_allclose().
assert np.all(arr[0].item == [0, 1, 2]) and \
np.all(arr[1].item == [3, 4, 9]) and \
np.all(cc.clusters[2].elements == [5, 6, 7]) and \
cc.clusters[0].object == 1 , \
"Collection incorrect"
What should be my approach if I wish to solve the issue with np.testing.assert_allclose()?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
