environmentaltools.common.gaps

environmentaltools.common.gaps(data: DataFrame, variables: str | list, file_name: str = 'gaps', buoy: bool = False)[source]

Create summary table of data gaps for time series variables.

Analyzes time series to identify gaps, sampling frequency, and data quality metrics. Saves results to Excel file.

Parameters:
  • data (pd.DataFrame) – Time series data with datetime index.

  • variables (str or list) – Variable name(s) to analyze for gaps.

  • file_name (str) – Output filename (without extension) for the gap summary table. Defaults to “gaps”.

  • buoy (bool) – If True, includes quality control metrics assuming ‘Qc_e’ column exists. Defaults to False.

Returns:

Summary table with columns including cadency, accuracy,

period, number of years, gap percentage, median gap, and maximum gap.

Return type:

pd.DataFrame