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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ROR4RSS4NWWE7PU64UE5SPNICZJZHCRZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to