8000 DOC: Add take_along_axis to the see also section in argmin, argmax etc. by mproszewska · Pull Request #14799 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Add take_along_axis to the see also section in argmin, argmax etc. #14799

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

Merged
merged 18 commits into from
Nov 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update numpy/core/fromnumeric.py
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
  • Loading branch information
mproszewska and eric-wieser authored Nov 2, 2019
commit af2c10e3b78c98bae3fa0f57695080f49bb444fd
2 changes: 1 addition & 1 deletion numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ def argmax(a, axis=None, out=None):
>>> np.take_along_axis(x, np.expand_dims(np.argmax(x, axis=-1), axis=-1), axis=-1) # same as `np.max(x, axis=-1, keepdims=True)`
array([[4],
[3]])
>>> np.take_along_axis(x, np.expand_dims(np.argmax(x, axis=-1), axis=-1), axis=-1).squeeze(axis=-1) # same as np.max(x, axis=-1)
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1).squeeze(axis=-1) # same as np.max(x, axis=-1)
array([4, 3])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

53DD

These lines are quite long. Maybe move the comment to stand alone in the line above the code

"""
Expand Down
0