Recently I stumbled over this quite unintuitive behaviour:
import numpy as np
max([0, np.nan]) # 0
max([np.nan, 0.0]) # np.nan
I assume the max function sees both entries as maximal and - according to the documentation - returns the first one. I have to admit, that I do not know how the Python function max knows what to do with numpy types in general. Of course, np.max returns the expected result (np.nan). I am using Python 3. Does someone know what's going on here?