-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Closed
Labels
Description
np.isclose is very slow compared with math.isclose
Reproducing code example:
import numpy as np
import timeit
print(timeit.timeit('np.isclose(0.5, 0, atol=1e-4)', 'import numpy as np', number=10000))
# 0.487607091999962
print(timeit.timeit('math.isclose(0.5, 0, abs_tol=1e-4)', 'import math', number=10000))
# 0.007888869999987946
Error message:
Numpy/Python version information:
1.17.4 3.7.5 (default, Dec 9 2019, 22:42:26)
[Clang 11.0.0 (clang-1100.0.33.12)]
Jamim