1import numpy as np
2np.isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False)
3
1# credit to the Stack Overflow user in the source link
2# method of the 'math' module
3
4def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
5 return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)