flasc.data_processing.dataframe_manipulations.df_find_and_fill_data_gaps_with_missing#
- flasc.data_processing.dataframe_manipulations.df_find_and_fill_data_gaps_with_missing(df, missing_data_buffer=5.0)[source]#
Find and fill data gap and mark as missing data with NaN.
- This function takes a pd.DataFrame object and look for large jumps in
the 'time' column. Rather than simply interpolating these values using a ZOH, this rather indicates that measurements are missing. Hence, this function finds these time gaps and inserts an additional row extra 1 second after the start of the time gap with all 'nan' values. This way, the data gap becomes populated with 'nan' values and the data will be ignored in any further analysis.
- Parameters:
df (pd.Dataframe) -- Merged dataframe for all imported files
missing_data_buffer (int, optional) -- If the time gaps are equal or larger than this limit [s], then it will consider the data as corrupted or missing. Defaults to 10.
- Returns:
- The postprocessed dataframe where all data
within large time gaps hold value 'missing'.
- Return type:
pd.Dataframe