TimeFrame.qc_check

TimeFrame.qc_check(check, column_name, observation_interval=None, into=False, **kwargs)[source]

Apply a quality control check to the TimeFrame.

Parameters:
  • check (Union[str, Type[QCCheck], QCCheck]) – The QC check to apply.

  • column_name (str) – The column to perform the check on.

  • observation_interval (tuple[datetime, datetime | None] | None) – Optional time interval to limit the check to.

  • into (str | bool) – Whether to add the result of the QC to the TimeFrame dataframe (True | string name of column to add), or just return a boolean Series of the QC result (False).

  • **kwargs – Parameters specific to the check type.

Return type:

TimeFrame | Series

Returns:

Result of the QC check, either as a boolean Series or added to the TimeFrame dataframe

Examples

# Threshold check ts_flagged = tf.qc_check(“comparison”, “battery_voltage”, compare_to=12.0, operator=”<”)

# Range check ts_flagged = tf.qc_check(“range”, “temperature”, min_value=-50, max_value=50)

# Spike check ts_flagged = tf.qc_check(“spike”, “wind_speed”, threshold=5.0)

# Value check for error codes ts_flagged = tf.qc_check(“comparison”, “status_code”, compare_to=[99, -999, “ERROR”])