Datasets:
D2: Data Quality + Spec Compliance
Goal
Process the input dataset and produce output that satisfies ALL quality rules.
Hard Requirements
- Read
data/input/records.csvand producedata/output/clean.csv. - Script:
python clean.py - Quality rules:
- Missing values: Any cell with empty string or
"N/A"must be replaced with"MISSING". - Sort order: Output must be sorted by
scoredescending, then bynameascending (alphabetical). - Deduplication: Rows with the same
idmust be deduplicated, keeping the row with the higherscore. - Range check:
scoremust be between 0 and 100 inclusive. Rows outside this range must be dropped entirely. - Department correction: Rows where
departmentresolves to"MISSING"ANDscoreis less than 50 must have theirdepartmentvalue set to"review_needed"rather than left as"MISSING".
- Missing values: Any cell with empty string or
- Output columns:
[id, name, score, department]— exact order. - No header row modifications (keep original column names).
- Output must use UTF-8 encoding with Unix line endings.
Deliverables
- Fixed
clean.pyin workspace. - Verifier must confirm all quality rules and produce attestation.