You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing np.seterr(invalid='raise'), FloatingPointErrors are raised when comparing NaNs of array length greater than 1, but not when comparing NaNs of array length equal to 1. It's easiest to see what's happening by looking at the code example:
importnumpyasnpnp.seterr(invalid='raise')
# {'over': 'warn', 'under': 'ignore', 'invalid': 'warn', 'divide': 'warn'}np.array([np.nan]) <0# array([False], dtype=bool)np.array([np.nan, np.nan]) <0# Traceback (most recent call last):# File "<stdin>", line 1, in <module># FloatingPointError: invalid value encountered in less
System info:
$ uname -a
Linux a 4.4.0-78-generic #99~14.04.2-Ubuntu SMP Thu Apr 27 18:49:46 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ python -c 'import numpy; print numpy.__version__'
1.13.0
$ python --version
Python 2.7.6
The text was updated successfully, but these errors were encountered:
When doing
np.seterr(invalid='raise')
, FloatingPointErrors are raised when comparing NaNs of array length greater than 1, but not when comparing NaNs of array length equal to 1. It's easiest to see what's happening by looking at the code example:System info:
The text was updated successfully, but these errors were encountered: