numpy.maximum since 1.15 raises RuntimeWarning when encountering a NaN even though the docs say it should propagate NaNs · Issue #12038 · numpy/numpy · GitHub
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
numpy.maximum now raises a RuntimeWarning when encountering a NaN, but the documentation says it propagates NaNs and even goes to the trouble of saying exactly how they are propagated, which makes it seem like it shouldn't give a warning.
Reproducing code example:
In [1]: importnumpyasnpIn [2]: x=np.array([1, 2, np.nan], dtype=float)
In [3]: np.maximum(x, x)
/home/tudor/anaconda3/bin/ipython:1: RuntimeWarning: invalidvalueencounteredinmaximum#!/home/tudor/anaconda3/bin/pythonOut[3]: array([ 1., 2., nan])