Python | numpy.assert_allclose() method
With the help of
numpy.assert_allclose() method, we can get the assertion errors when two array objects are not equal upto the mark by using
Return : Return the Assertion error if two array objects are not equal.
Example #1 :
In this example we can see that using
numpy.assert_allclose() method, we are able to get the assertion error if two arrays are not equal.
Example #2 :
Max absolute difference: 3
Max relative difference: 0.75
gfg1: array([1, 2, 3])
gfg2: array([4, 5, 6])
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course