clip
Clip (limit) the values in an array to a given range.| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | - | Input array. |
a_min | number | null | - | Minimum value. Elements below this are set to a_min. Pass null to skip the lower bound. |
a_max | number | null | - | Maximum value. Elements above this are set to a_max. Pass null to skip the upper bound. |
NDArray — Array with values clipped to [a_min, a_max].
maximum
Element-wise maximum of two arrays. Propagates NaN.| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | - | First input array. |
x2 | ArrayLike | number | - | Second input array or scalar. |
NDArray — Element-wise maximum. If either element is NaN, the result is NaN.
minimum
Element-wise minimum of two arrays. Propagates NaN.| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | - | First input array. |
x2 | ArrayLike | number | - | Second input array or scalar. |
NDArray — Element-wise minimum. If either element is NaN, the result is NaN.
fmax
Element-wise maximum of two arrays, ignoring NaN. If one element is NaN, the other is returned.| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | - | First input array. |
x2 | ArrayLike | number | - | Second input array or scalar. |
NDArray — Element-wise maximum, ignoring NaN.
fmin
Element-wise minimum of two arrays, ignoring NaN.| Name | Type | Default | Description |
|---|---|---|---|
x1 | ArrayLike | - | First input array. |
x2 | ArrayLike | number | - | Second input array or scalar. |
NDArray — Element-wise minimum, ignoring NaN.
nan_to_num
Replace NaN with zero and infinity with large finite numbers (or specified values).| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array. |
nan | number | 0.0 | Value to replace NaN with. |
posinf | number | undefined | Value to replace positive infinity. Defaults to a very large finite number. |
neginf | number | undefined | Value to replace negative infinity. Defaults to a very large negative finite number. |
NDArray — Array with NaN/Inf replaced.
interp
One-dimensional linear interpolation for monotonically increasing sample points.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | x-coordinates at which to evaluate the interpolation. |
xp | ArrayLike | - | x-coordinates of the data points (must be increasing). |
fp | ArrayLike | - | y-coordinates of the data points (same length as xp). |
left | number | fp[0] | Value to return for x < xp[0]. |
right | number | fp[fp.length - 1] | Value to return for x > xp[-1]. |
NDArray — Interpolated values at each point in x.
sinc
Return the normalized sinc function:sin(pi*x) / (pi*x). The sinc function is 1 at x = 0.
| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array. |
NDArray — Element-wise sin(pi*x) / (pi*x).
i0
Modified Bessel function of the first kind, order 0.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array (argument of the Bessel function). |
NDArray — Element-wise modified Bessel function I_0(x).
unwrap
Unwrap by changing deltas between values to their2*pi complement. Useful for unwrapping radian phase data.
| Name | Type | Default | Description |
|---|---|---|---|
p | ArrayLike | - | Input array of phase angles. |
discont | number | Math.PI | Maximum discontinuity between consecutive values. Jumps larger than this are wrapped. |
axis | number | -1 | Axis along which to unwrap. |
period | number | 2 * Math.PI | Wrapping period. |
NDArray — Unwrapped array.
real
Return the real part of each element. For real-valued arrays, returns a copy.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array (real or complex). |
NDArray — The real part of each element.
imag
Return the imaginary part of each element. For real-valued arrays, returns zeros.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array (real or complex). |
NDArray — The imaginary part of each element.
conj
Return the complex conjugate, element-wise. For each elementa + bi, returns a - bi. Also available as the alias conjugate.
| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array (real or complex). |
NDArray — Complex conjugate of each element.
angle
Return the angle (argument) of complex numbers.| Name | Type | Default | Description |
|---|---|---|---|
x | ArrayLike | - | Input array of complex numbers. |
deg | boolean | false | If true, return angles in degrees instead of radians. |
NDArray — The counterclockwise angle from the positive real axis, in radians (or degrees if deg is true).