Back to Numerical Arrays (NumPy)
np.partition
Return a partitioned copy of an array.
Syntax
np.partition(a, kth, axis?)
Description
Return a partitioned copy of an array. Creates a copy of the array with its elements rearranged so that elements smaller than the kth element are moved before it and elements greater are moved after it.
Parameters
| Name | Description |
|---|---|
| a | - Array to partition |
| kth | - Index to partition around |
| axis(optional) | - Axis along which to partition (default: -1) |
Returns
Promise<NDArray>