[SciPy-Dev] `scipy.stats` NaN handling policy

Paul Hobson pmhobson at gmail.com
Mon Aug 3 12:58:15 EDT 2015


On Mon, Aug 3, 2015 at 12:02 AM, Abraham Escalante <aeklant at gmail.com>
wrote:

> Hello all,
>
> As some of you may know, for the last two months or so we have been trying
> to get the community to converge on a policy to handle NaN values in
> `scipy.stats`. I will not go into details because it would take too long,
> but you can follow the discussion in gh-571
> <https://github.com/scipy/scipy/issues/571> or the PR in gh-5007
> <https://github.com/scipy/scipy/pull/5007>.
>
> The implementation details are all but complete at this point but I would
> like to ask for opinions on the API naming.
>
> In summary, I added a keyword called "nan_policy", with options
> "propagate", "raise" and "omit", where "propagate" returns a NaN value,
> "raise" throws a ValueError and "omit" delegates to the equivalent masked
> array function, omitting the NaN values.
>
> Alternate names proposed:
>
>    - "nan_policy" --> "nan_check", "on_nan", "nan_action"
>    - "propagate" --> "undefined"
>    - "omit" --> "ignore", "missing"
>
> We are still open for naming suggestions as long as the community agrees.
> If people seem happy with the choices we have already made, this PR will be
> merged soonish (two or three days maybe).
>

 I preferences are:

 - "nan_policy"
 - "propagate"
 - "raise"
 - "ignore"

Though I can how perhaps "omit" (or even "drop") would be better
communicate the intent.
-paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150803/8c3fc58c/attachment.html>


More information about the SciPy-Dev mailing list