-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC: Add example to amax docstring #24676
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
Conversation
numpy/core/fromnumeric.py
Outdated
-------- | ||
>>> np.amax([4]) | ||
4 | ||
>>> np.amax([4,-1, 67, 89]) |
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.
>>> np.amax([4,-1, 67, 89]) | |
>>> np.amax([4, -1, 67, 89]) |
numpy/core/fromnumeric.py
Outdated
4 | ||
>>> np.amax([4,-1, 67, 89]) | ||
89 | ||
>>> np.amax([[1,2,3,46,44],[2,3,4,55,5]], axis=0) |
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.
>>> np.amax([[1,2,3,46,44],[2,3,4,55,5]], axis=0) | |
>>> np.amax([[1, 2, 3, 46, 44], [2, 3, 4, 55, 5]], axis=0) |
I prefer the example to follow pep8. (not sure this is required, but the example at https://numpydoc.readthedocs.io/en/latest/format.html#examples follows the style as well)
@eendebakpt I have made the required changes. |
numpy/core/fromnumeric.py
Outdated
89 | ||
>>> np.amax([[1, 2, 3, 46, 44],[2, 3, 4, 55, 5]], axis=0) | ||
array([2, 3, 4, 55, 44]) | ||
>>> np.amax([[1, 2, 3, 46, 44],[2, 3, 4, 55, 5]], axis=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.
>>> np.amax([[1, 2, 3, 46, 44],[2, 3, 4, 55, 5]], axis=1) | |
>>> np.amax([[1, 2, 3, 46, 44], [2, 3, 4, 55, 5]], axis=1) |
@eendebakpt I made the suggested change. |
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.
The docstring makes clear that amax
is an alias for max
. I'd vote to continue referring users to the np.max
documentation rather than add explicit examples here.
@rossbar Alright. |
Thanks @ankur0904 , I'll go ahead and close this. |
Added example to the
amax
function offromnumeric.py
. #22266@InessaPawson Please have a look.