[FEA] argmin and argmax for Series and Indexes
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
For pandas API compatibility, it would be nice to implement argmax and argmin on various Series and Indexes. Argmax (argmin) is a reduction that accepts a column or index and returns the *integer position* of the largest (smallest) value in the data. If the maximum (minimum) is achieved in multiple locations, the first row position is returned.
We already have per group argmin and argmax aggregations in libcudf, as they were implemented for `Groupby.{idxmax, idxmin}` in cuDF Python. They are not currently part of the reduction machinery, [as far as I can tell from a quick glance](https://github.com/rapidsai/cudf/blob/c6bc111a18803b4a56e8090f237af00e5b5296ae/cpp/src/reductions/reductions.cpp) so this may require a separate implementation.
Note that argmin and argmax are different from idxmin and idxmax. The latter methods return the *index label* associated with the minimum or maximum value. The index label may not be an integer.
Implementing Series and Index argmin and argmax would likely enable implementing https://github.com/rapidsai/cudf/issues/1480 .
Contributor guide
Assessment
This issue has not been assessed yet.