CSV Cleaning

Load a messy CSV, assess quality and export a cleaned copy.

Overview

The canonical EazyDataFix workflow — read a CSV, understand what is wrong with it, then apply the automatic cleaning pipeline and export the result.

Dataset

employees.csv12 rows × 8 columns
employee_idnameemaildepartmentsalaryhire_dateactivecity

Synthetic sample with missing markers, whitespace and one duplicate row.

Python code

csv-cleaning.py
import eazydatafix as edf

config = edf.FixConfig(
    missing_markers=("", "N/A", "null"),
)
report = edf.assess("employees.csv")
result = edf.fix("employees.csv", config)
result.save("employees.clean.csv")

print(f"Quality before: {report.quality.score:.2f}")
print(result.applied_fixes)

Expected output

Python 3.11
>>> report = edf.assess("employees.csv")
>>> result = edf.fix("employees.csv", config)
Quality before: 82.76
 
>>> print(result.applied_fixes)
['Trimmed leading/trailing whitespaces.', 'Removed 1 duplicate row(s).', "Filled numeric column 'salary' using median."]