neurodsp.utils.outliers.restore_nans

neurodsp.utils.outliers.restore_nans(sig, sig_nans, dtype=<class 'float'>)[source]

Restore NaN values to the edges of an array.

Parameters
sig1d or 2d array

Signal that has had NaN edges removed.

sig_nans1d array

Boolean array indicating where NaNs were in the original array.

Returns
sig_restored1d or 2d array

Signal with NaN edges restored.

Notes

If sig is 2d, the sig_nans input should reflect the values for a row. This function assumes the same columns to be NaN across all rows.