<div dir="ltr">I'm having some trouble understanding the behaviour of np.min when used with NaN. In the documentation of np.amin it says: "NaN values are propagated, that is if at least one item is NaN, the corresponding min value will be NaN as well. ". It doesn't say that in some circumstances there will be RuntimeWarning's raised (presumably depending on the errstate). Consider the following:<br><br><br>>>> import numpy as np<br>>>> np.min([1, np.nan])<br>/Users/andrew/miniconda3/envs/dev3/lib/python3.6/site-packages/numpy/core/_methods.py:29: RuntimeWarning: invalid value encountered in reduce<br>  return umr_minimum(a, axis, None, out, keepdims)<br>nan<br>>>> np.min([1, 2, np.nan])<br>nan<br>>>> np.min([np.nan, 1, 2])<br>nan<br>>>> np.min([np.nan, 1])<br>nan<div><br></div><div>Why is there a RuntimeWarning for the first example, but not the others? Is this expected behaviour?</div><div><br></div><div><br></div><div><br></div><div>-- <br><div class="gmail_signature">_____________________________________<br>Dr. Andrew Nelson<br><br><br>_____________________________________</div>
</div></div>