Search & Count
Functions that locate elements by position (argmin, argmax), compute order statistics (percentile, quantile), or count elements matching a condition.argmin
Return the index of the minimum value along an axis.| Parameter | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
axis | number | undefined | Axis along which to search. When undefined, operates on the flattened array. |
number when no axis is specified, NDArray of indices when an axis is given.
argmax
Return the index of the maximum value along an axis.| Parameter | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
axis | number | undefined | Axis along which to search. When undefined, operates on the flattened array. |
number when no axis is specified, NDArray of indices when an axis is given.
percentile
Compute the q-th percentile of the data along the specified axis.| Parameter | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
q | number | number[] | — | Percentile(s) to compute, in the range [0, 100]. |
axis | number | number[] | undefined | Axis or axes along which to compute percentiles. |
keepdims | boolean | false | If true, reduced axes are kept as dimensions with size 1. |
number for a single percentile over all axes, NDArray when computing multiple percentiles or along specific axes.
quantile
Compute the q-th quantile of the data along the specified axis. Equivalent topercentile but with q in the range [0, 1] instead of [0, 100].
| Parameter | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
q | number | number[] | — | Quantile(s) to compute, in the range [0, 1]. |
axis | number | number[] | undefined | Axis or axes along which to compute quantiles. |
keepdims | boolean | false | If true, reduced axes are kept as dimensions with size 1. |
number for a single quantile over all axes, NDArray when computing multiple quantiles or along specific axes.
count_nonzero
Count the number of non-zero elements in the array.| Parameter | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
axis | number | number[] | undefined | Axis or axes along which to count non-zero values. |
keepdims | boolean | false | If true, reduced axes are kept as dimensions with size 1. |
number when counting over all axes, NDArray when counting along specific axes.