edfEazyDataFix

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

  1. Normalise whitespace and Unicode
  2. Coerce obvious dtypes (dates, numbers, booleans)
  3. Drop exact duplicate rows
  4. Impute missing values per column
  5. Emit an applied_fixes log

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
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:

dry_run.py
result = edf.fix("employees.csv", dry_run=True)
result.diff()
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.