-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: Updated documentation for nan_policy=propagate as per #9947 #9948
Conversation
… an example for stats.mode to make behaviour clear
@Sedosa thanks for taking the time to make a contribution. There are only a few nitpicks which stand out to me:
@rgommers would you mind taking a look at this? The issue occurs that
This PR changes the existing documentation of |
sounds good to me |
[ 1., 2., 2., nan], | ||
[ 1., 1., 1., nan]]) | ||
>>> stats.mode(a, nan_policy='propagate') | ||
ModeResult(mode=array([[1., 1., 2., 3.]]), count=array([[3, 2, 2, 1]])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this seems wrong? given the discussion, should be [1., 1., 2., nan]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood the discussion to imply the absence of nan in the returned array was what warranted the example..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still ongoing in gh-9815 it seems, let's continue there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an example with a 1d vector is easier to understand to illustrate the behaviour.
@rgommers should we consider merging this? The other discussions seem to have stalled and this documents the current behaviour better than the existing documentation. The only real improvement I can see would be to change the example to be 1d. |
I agree |
I'd rather finish the discussion, because if we merge this and leave it that effectively decides the discussion by explicitly documenting behavior (so we shouldn't change it later without deprecation because it's a bug). Could both of you indicate on the issue what your preferred behavior is? |
Updated documentation for nan_policy='propagate' as per #9947 and added an example for stats.mode to make behaviour clear.
nan_policy='propagate
in multiple stats functions #9947)nan_policy='propagate
in multiple stats functions #9947