
On Tue, Aug 24, 2021 at 01:53:51PM +1000, Steven D'Aprano wrote:
I've spoken to users of other statistics packages and languages, such as R, and I cannot find any consensus on what the "right" behaviour should be for NANs except "not that!".
So I propose that statistics functions gain a keyword only parameter to specify the desired behaviour when a NAN is found:
Thanks everyone for the feedback, does anyone have a strong opinion on what to name this parameter? In R, the usual parameter name is typically "na.rm" to remove them: https://stat.ethz.ch/R-manual/R-patched/library/base/html/mean.html https://stat.ethz.ch/R-manual/R-patched/library/stats/html/sd.html Matlab optionally takes one of two strings: https://au.mathworks.com/help/matlab/ref/mean.html?#d123e832786 It doesn't seem to have named parameters. I'm leaning towards "nans=..." with an enum. -- Steve