Fixing
edf.fix() runs an opinionated, deterministic cleaning pipeline and returns a FixResult that includes the cleaned DataFrame plus an audit trail.
The default pipeline
- Normalise whitespace and Unicode
- Coerce obvious dtypes (dates, numbers, booleans)
- Drop exact duplicate rows
- Impute missing values per column
- Emit an
applied_fixeslog
Strategies
Pass strategy="safe" | "auto" | "aggressive" to trade caution for coverage:
safe— only non-destructive fixes.auto— the balanced default.aggressive— drops columns with >90% missing values.
fixing.py
python
import eazydatafix as edf
result = edf.fix("employees.csv", strategy="safe")
result.applied_fixes
result.to_csv("clean.csv")Dry run
Preview what would change without materialising a new DataFrame:
Python 3.11
>>> result = edf.fix("employees.csv", dry_run=True)>>> result.diff() strip_whitespace: 42 cells drop_duplicates: 6 rows impute_missing: 38 cells (median)Exporting
result.to_csv() and result.to_excel() write the cleaned dataset. See the reference for every option.