Skip to content

FreshData Cookbook

Practical, copy-paste recipes targeting common data cleaning, validation, and pipeline challenges in Python.

Every recipe is self-contained with runnable code, realistic sample outputs, and architectural explanations.


High-Intent Recipes

  • How to automatically clean a pandas DataFrame Standardize column headers, trim whitespace, fix dtypes, and normalize sentinel strings in one line. (Search intent: automatic pandas data cleaning, clean dataframe python)

  • How to safely handle missing values Role-aware imputation: why identifiers and targets must be preserved while numerics are safely imputed. (Search intent: safe missing value imputation, fillna without corruption)

  • How to detect and resolve duplicate rows Report duplicate clusters without silent row drops, and apply controlled deduplication policies. (Search intent: detect duplicate rows pandas, safe deduplication python)

  • How to prepare tabular data for machine learning Zero-leakage data hygiene for scikit-learn, XGBoost, and PyTorch pipelines. (Search intent: ml tabular data preprocessing, prevent target leakage)

  • How to clean Polars DataFrames Native Polars in -> Polars out data cleaning with zero pandas conversion overhead. (Search intent: polars clean dataframe, polars data quality)

  • How to add data cleaning to an ETL pipeline Integrate FreshData and quality trust gates into Airflow, Prefect, and Dagster workflows. (Search intent: etl data cleaning pipeline, airflow data quality gate)

  • How to audit automated data cleaning Generate machine-readable JSON and Markdown audit trails documenting every transformed cell. (Search intent: data cleaning audit trail, explainable data cleaning)