Sorting NaNs

Anders Munch andersjm at stofanet.dk
Sun Jun 10 15:28:02 EDT 2018


Richard Damon wrote:

> The two behaviors that I have heard suggested are:
>
> 1) If any of the inputs are a NaN, the median should be a NaN.
> (Propagating the NaN as indicator of a numeric error)
>
> 2) Remove the NaNs from the input set and process what is left. If
> nothing, then return a NaN (treating NaN as a 'No Data' placeholder).

3) Raise an exception.

I can't believe anyone even suggested 2).  "In the face of ambiguity, 
refuse the temptation to guess."

regards, Anders




More information about the Python-list mailing list