metobs_toolkit.dataset.Dataset.get_qc_stats#
- Dataset.get_qc_stats(obstype: str = 'temp', make_plot: bool = True) dict[str, pd.Series] | Figure[source]#
Summarize QC label frequencies across all stations for a given observation type.
This aggregates three series over every station that has the requested
obstype:final label counts from each
SensorData.df['label'].value_counts();outlier-only label counts from
SensorData.outliersdf['label'].value_counts();per-check outcome counts from
SensorData.get_qc_freq_statistics()(MultiIndex['checkname', 'flag']).
When
make_plotis True, the aggregated counts are visualized withplotting.qc_overview_pies. When False, the aggregated series are returned for programmatic use.- Parameters:
obstype (str, optional) – Observation type to evaluate, by default “temp”.
make_plot (bool, optional) – If True, return a figure with pie charts; if False, return the aggregated counts. Default is True.
- Returns:
matplotlib.figure.Figure or dict[str, pandas.Series] – Figure with QC overview pies when
make_plotis True; otherwise a dictionary with keysall_labels,outlier_labels, andper_check_labels. Returns None when no stations provide the requestedobstype... versionchanged:: 1.1.0 – When
make_plot=False, the return type changed frompandas.DataFrametodict[str, pandas.Series]with keysall_labels,outlier_labels, andper_check_labels. Update any code that previously unpacked or indexed the returned DataFrame.