mlx.core.argpartition#
- argpartition(a: array, /, kth: int, axis: None | int = -1, *, stream: None | Stream | Device = None) array#
 Returns the indices that partition the array.
The ordering of the elements within a partition in given by the indices is undefined.
- Parameters:
 a (array) – Input array.
kth (int) – Element index at the
kthposition in the output will give the sorted position. All indices before thekthposition will be of elements less or equal to the element at thekthindex and all indices after will be of elements greater or equal to the element at thekthindex.axis (int or None, optional) – Optional axis to partition over. If
None, this partitions over the flattened array. If unspecified, it defaults to-1.
- Returns:
 The
uint32array containing indices that partition the input.- Return type: