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 b4d08000e600d7ecb009dab7c1ce89d33bcb205c
2 changes: 1 addition & 1 deletion numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ def argmin(a, axis=None, out=None):
>>> np.take_along_axis(x, np.expand_dims(index_array, axis=-1), axis=-1)
array([[2],
[0]])
>>> np.take_along_axis(x, np.expand_dims(np.argmin(x, axis=-1), axis=-1), axis=-1).flatten() # 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)
Copy link
Member
@eric-wieser eric-wieser Nov 3, 2019

Choose a reason for hiding this comment

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

Nit: pep8 wants two spaces before #, same on other lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I was looking for that bug

array([2, 0])

"""
Expand Down
0