<div dir="ltr">On Wed, Jan 10, 2018 at 3:03 PM, Andrew Nelson <<a href="mailto:andyfaff@gmail.com">andyfaff@gmail.com</a>> wrote:<br>><br>> Further to my last message, why is the warning only raised once?<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, np.nan])<br>> nan<br>> >>><br>> ```<br><br>This is default behavior for warnings.<div><br><div><a href="https://docs.python.org/3/library/warnings.html#the-warnings-filter">https://docs.python.org/3/library/warnings.html#the-warnings-filter</a><br><br>It also explains the previous results. The same warning would have been issued from the same place in each of the variations you tried. Since the warnings mechanism had already seen that RuntimeWarning with the same message from the same code location, they were not printed.<br><br>--<br>Robert Kern</div></div></div>