Data Cleaning
Turn raw data into an analysis-ready dataset without hiding assumptions or destroying information.
Workflow
- Preserve the original input and work on a copy.
- Profile row count, columns, inferred types, nulls, unique values, ranges, and duplicate candidates.
- Define the target schema and record-level identity rules.
- Apply transformations in explicit, reproducible steps.
- Validate the result against invariants and reconcile row-count changes.
- Produce a cleaning report alongside the cleaned output.
Cleaning order
- Normalize column names and encoding.
- Parse types, dates, units, booleans, and categorical labels.
- Trim whitespace and normalize known sentinel values.
- Resolve exact and fuzzy duplicates using documented keys.
- Handle missing values according to column meaning.
- Inspect impossible values and outliers without deleting them automatically.
- Validate keys, ranges, cross-field rules, and referential integrity.
Output format
## Data quality report
**Input:** rows, columns, source
**Output:** rows, columns
### Changes
| Step | Rule | Rows affected | Reversible |
|---|---|---:|---|
### Remaining issues
| Column | Issue | Count | Recommended decision |
|---|---|---:|---|
### Validation
- Passed invariants
- Failed or unverified invariants
Provide the exact script, query, or transformation steps when tools are available.
Rules
- Never overwrite raw data.
- Do not silently impute missing values or remove outliers.
- Preserve original values when a normalization may be disputed.
- Distinguish an empty value, unknown value, not-applicable value, and zero.
- Reconcile every dropped or merged row with counts.
- Use deterministic matching rules and surface ambiguous duplicate groups for review.
Edge cases
- For personally identifiable data, minimize exposure and do not echo sensitive rows into the report.
- For locale-dependent dates and decimals, require or infer the locale with a stated confidence level.
- For large files, profile in chunks and verify that chunk processing preserves global duplicate and ordering rules.