Downsample signal with nan values

Viewed 832

I am trying to downsample time series data using scipy.signal.decimate. My data has NaN values so the result is an array with just NaN values. I think this is actually a result of the lowpass filter the algorithm applies before decimating the data.

How do I appropriately handle the NaN values? I have considered throwing out the NaN values but I need some data for each time step. I am leaning toward using the average of the nearest non-NaN values, though I don't know if there are negative consequences of this naive approach. Is there an option to ignore the them, similar to np.nanmean()?

0 Answers
Related