
...on the acceptance of his PEP! PEP 485 adds a math.isclose function to the standard library, encouraging people to do numerically more reasonable floating point comparisons. The PEP: https://www.python.org/dev/peps/pep-0485/ The pronouncement: http://thread.gmane.org/gmane.comp.python.devel/151776/focus=151778 -n -- Nathaniel J. Smith -- http://vorpus.org

Indeed, congratulations Chris! Are there plans to write a vectorized version for NumPy? :) On Mon, Mar 2, 2015 at 2:28 PM, Nathaniel Smith <njs@pobox.com> wrote:
...on the acceptance of his PEP! PEP 485 adds a math.isclose function to the standard library, encouraging people to do numerically more reasonable floating point comparisons.
The PEP: https://www.python.org/dev/peps/pep-0485/
The pronouncement: http://thread.gmane.org/gmane.comp.python.devel/151776/focus=151778
-n
-- Nathaniel J. Smith -- http://vorpus.org _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user

On Mon, Mar 2, 2015 at 2:57 PM, Stephan Hoyer <shoyer@gmail.com> wrote:
Indeed, congratulations Chris!
Are there plans to write a vectorized version for NumPy? :)
np.isclose isn't identical, but IIRC the only difference is the defaults. -n -- Nathaniel J. Smith -- http://vorpus.org

Are there plans to write a vectorized version for NumPy? :)
np.isclose isn't identical, but IIRC the only difference is the defaults.
There are subtle differences in the algorithm as well. But not enough that it makes sense to change the numpy one. The results will be similar in most cases, and identical fir a relative tolerance less than 1e-8 (for float64). -Chris
-n
-- Nathaniel J. Smith -- http://vorpus.org _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Mon, Mar 2, 2015 at 5:51 PM, Nathaniel Smith <njs@pobox.com> wrote:
On Mon, Mar 2, 2015 at 2:57 PM, Stephan Hoyer <shoyer@gmail.com> wrote:
Indeed, congratulations Chris!
Are there plans to write a vectorized version for NumPy? :)
np.isclose isn't identical, but IIRC the only difference is the defaults.
There are two differences I saw. Numpy requires the error to be less than the sum of the relative and absolute errors, the pep uses the maximum of the two. The other is that numpy as a key word for nans to compare equal. Chuck
participants (4)
-
Charles R Harris
-
Chris Barker - NOAA Federal
-
Nathaniel Smith
-
Stephan Hoyer