On 6/10/18 3:28 PM, Anders Munch wrote: > 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 > Many people doing statistics (mis-)use 'NaN' as a flag for 'missing data for this record'. If you want the statistic of a sample as an estimate of the statistic of the population, then omitting 'missing data' can be a reasonable option. I will agree that I see issues with this attitude, but it isn't uncommon.
-- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list