Back to Numerical Arrays (NumPy)
np.ptp
Range of values (maximum - minimum) along an axis.
Syntax
np.ptp(a, axis?, keepdims?)
Description
Range of values (maximum - minimum) along an axis. The name of the function comes from the acronym for 'peak to peak'.
Parameters
| Name | Description |
|---|---|
| a | - Input array |
| axis(optional) | - Axis along which to find the peak-to-peak value. null computes ptp of flattened array. |
| keepdims(optional) | - If true, reduced axes are left with size 1 |
Returns
Promise<NDArray | number>