trimnans
biosigpy.tools.trimnans.trimnans ¶
trimnans(signal: ArrayLike) -> np.ndarray
Remove leading and trailing NaNs, preserving internal gaps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signal | array_like | One-dimensional real signal containing finite values or NaN. Row and column vectors represent the same sequence. | required |
Returns:
| Name | Type | Description |
|---|---|---|
trimmed_signal | ndarray | Independent one-dimensional copy of the inclusive first-to-last finite span. Empty and all-NaN inputs return an empty vector. |
Raises:
| Type | Description |
|---|---|
TypeError | If the signal is not real numeric data. |
ValueError | If the signal is not a vector or contains infinite values. |
Notes
No interpolation is performed. Preserve the original time offset separately if the trimmed signal must remain aligned with other data.
Source code in src/biosigpy/tools/trimnans.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |