First contact with an unfamiliar dataset used to cost half a day of df.describe(), ad-hoc groupbys, and forgotten checks. With an AI assistant generating the profiling code and you verifying its claims against the actual data, you can produce a defensible data-quality report in under an hour — including the checks you would have forgotten.
Tier: Foundation · Workflow area: Data understanding & profiling
Skip AI for a dataset under ~10 columns you already know well — a manual df.info() pass is faster than reviewing generated code.
ydata-profiling for a baseline HTML report.Ground the assistant in real schema, not guesses. Run df.dtypes.to_string() and df.head(3).to_string() yourself and paste the output. Assistants hallucinate column names when given only a description.
Request a profiling plan before code. Plans are cheaper to correct than code:
Here is the schema and head of a pandas DataFrame `df` (~2.1M rows, order-level
e-commerce data). Before writing any code, list the data-quality checks you
would run, grouped by: completeness, uniqueness, validity (ranges/formats),
consistency (cross-column rules), and timeliness. Flag which checks are
most likely to reveal problems for a churn-modeling use case.
Generate the profiling script. Ask for one runnable cell:
Write a single pandas script implementing those checks. Requirements:
- Output a tidy DataFrame `quality_report` with columns: check_name, column,
result, threshold, pass_fail.
- Null share per column; duplicate-key rate on order_id; out-of-range checks
for amount (>0) and dates (within 2019-2026); category cardinality;
cross-field rule: shipped_date >= order_date.
- No plotting, no sampling — full dataset, chunked if memory requires.
Run it and interrogate anomalies. Execute the script yourself. For each failed check, paste the failing rows back and ask for hypotheses: Here are 20 rows where shipped_date < order_date. Give three plausible generating mechanisms and a follow-up query for each. Test-order artifacts, timezone bugs, and backfills each imply different fixes.
Cross-check against a deterministic profiler. Run ydata_profiling.ProfileReport(df, minimal=True) (or df.describe(include="all")) and diff the headline numbers — row count, null rates, distinct counts — against the assistant's report. Discrepancies mean the generated code has a bug (common: dropping NaN before counting them).
Draft the report, numbers pinned. Ask the assistant to write a one-page quality summary using only the quality_report values you paste in, with a "fit for churn modeling: yes/no/with caveats" verdict you edit and own.
The assistant proposes checks and writes the code; the numbers in your report come only from code you executed. Generated prose about data you did not run is fiction.
COUNT(*) - COUNT(col), duplicate keys via GROUP BY ... HAVING COUNT(*) > 1. Ask for one CTE per check writing into a results table.df.describe() output; you copy code into Jupyter manually. Slower loop, identical audit discipline.pass_fail threshold was set by you or explicitly agreed, not silently invented by the model.df.sample(10000) for speed; rare-category and duplicate-rate findings from samples are wrong. Demand full-data or chunked computation.df.dropna() before counting nulls, duplicated() without subset=, and string comparisons on unparsed dates. These pass review at a glance and corrupt every downstream number.cust_email → contact_field) if even schema is sensitive; keep a local mapping.df.describe() would have missed (cross-field violation, duplicate keys, silent type coercion).