DOC: argmin, argmax, argort, etc. should link to `np.take_along_axis` in their documentation
See original GitHub issueIn #6075, I wondered whether it might be possible to
to have some simple way to use the output of
np.arg[min|max|sort]
as a proper index (to avoid hackery as in https://github.com/astropy/astropy/blob/master/astropy/time/core.py#L896 – if there is a simpler way already, let me know!)
and @jaimefrio suggested that it might be simpler to have
a
make_me_an_indexing_tuple=False
new keyword argument for theargxxx
functions?
That indeed seems better, so I’m raising this as a separate issue. The code linked to above could be used as a template on how to generate the index tuple.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
numpy.argmin — NumPy v1.24 Manual
Returns the indices of the minimum values along an axis. ... If this is set to True, the axes which are reduced are...
Read more >numpy.argmin — NumPy v1.10 Manual
Returns the indices of the minimum values along an axis. Parameters: a : array_like. Input array. axis : int, optional.
Read more >Feature request: Allow np.argmax to output top K maximum ...
Currently np.argmax, np.argmin, np.max and np.min return the maximum and minimum values respectively. numpy.argmax(a, axis=None, out=None)
Read more >numpy.argmax() in Python - GeeksforGeeks
argmax () function returns indices of the max element of the array in a particular axis. Syntax : numpy.argmax(array, axis = None, out...
Read more >Command for argmin or argmax? - TeX - LaTeX Stack Exchange
As Pieter pointed out, the correct way to define argmin and argmax operators in LaTeX is: \usepackage{amsmath} \DeclareMathOperator*{\argmax}{arg\,max} ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it would be lot better than today’s implementation if the
axis=None
option returned something equivalent to :I think this issue is now irrelevant, since we have
np.take_along_axis
instead, which solves the issue. I will however transform it into a Documentation issue, since those functions should list it under the See Also section at least.