argmax
- sparse.argmax(x, /, *, axis=None, keepdims=False)[source]
Returns the indices of the maximum values along a specified axis. When the maximum value occurs multiple times, only the indices corresponding to the first occurrence are returned.
- Parameters:
x (SparseArray) – Input array. The fill value must be
0.0and all non-zero values must be greater than0.0.axis (int, optional) – Axis along which to search. If
None, the function must return the index of the maximum value of the flattened array. Default:None.keepdims (bool, optional) – If
True, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, ifFalse, the reduced axes (dimensions) must not be included in the result. Default:False.
- Returns:
out – If
axisisNone, a zero-dimensional array containing the index of the first occurrence of the maximum value. Otherwise, a non-zero-dimensional array containing the indices of the maximum values.- Return type: