# Project 3 — Data Quality Audit with AI
# From Spreadsheets to AI Tools — Book 6, Waskey Press

WHAT YOU WILL BUILD:
A prompt sequence that audits your sales data for quality issues
and generates a management-ready report.

PROMPT 1 — DETECT ERRORS
──────────────────────────
I have a sales dataset. Here are [N] rows:
[PASTE rows from sales.csv — include some dirty rows if possible]

Columns: date, customer, region, product, category, quantity, unit_price, total, status, sales_rep

Check for these data quality issues:
1. Invalid status (must be: Delivered, Shipped, Pending, Cancelled)
2. Total ≠ quantity × unit_price (allow €0.02 tolerance)
3. Missing or empty customer name
4. Date format issues (expected: YYYY-MM-DD)
5. Negative or zero total on non-Cancelled orders
6. Region not in: East, North, South, West

For each issue found, output:
Row number | Column | Issue type | Value found | Suggested fix

If no issues found, say "Data looks clean."

PROMPT 2 — WRITE THE AUDIT REPORT
───────────────────────────────────
Using these data quality findings:
[PASTE PROMPT 1 OUTPUT]

Dataset size: 2,150 rows
Write a 1-page data quality audit report:
- Executive summary (2 sentences)
- Issue breakdown table (issue type | count | % of rows)
- Root cause analysis (1 sentence per issue type)
- 3 recommendations to prevent these issues
- Overall data quality score: X/100

Tone: factual, constructive. Suitable for a Data Manager or CFO.

PROMPT 3 — PYTHON CLEANING CODE
──────────────────────────────────
Based on these issues:
[PASTE PROMPT 1 OUTPUT]

Write Python pandas code that:
1. Loads sales.csv
2. Fixes each identified issue programmatically
3. Reports how many rows were changed
4. Saves the cleaned file as sales_clean.csv
Include comments explaining each cleaning step.
