arista.preprocess.interpolate

Fill DAQ-dropped frames via linear interpolation.

Functions

interpolate_missing_frames(per_frame)

Linearly interpolate NaN values in a per-frame dataframe.

arista.preprocess.interpolate.interpolate_missing_frames(per_frame)[source]

Linearly interpolate NaN values in a per-frame dataframe.

Replicates aristaSingleCellData.interpolateMissingFrames: any NaN values left after arista.preprocess.align.collapse_to_frames() has reindexed the per-frame table to a contiguous integer range are filled by DataFrame.interpolate(method="linear").

Parameters:

per_frame (pandas.DataFrame) – DataFrame whose index is the integer frame number. Typical columns are epoch_time / sensor_t_c / target_t_c / drive_t_c but the function is agnostic.

Returns:

A new DataFrame with NaNs filled. The index is preserved.

Return type:

pandas.DataFrame