csv-data-cleaner
Profiles and cleans CSV/Excel data with pandas - types, missing values, duplicates, inconsistent categories and outliers - and reports every change. Use when the user shares a CSV or spreadsheet and asks to clean, normalise, dedupe or prepare it for analysis.
Data
Install
mkdir -p ~/.claude/skills/csv-data-cleaner # save the file below as ~/.claude/skills/csv-data-cleaner/SKILL.md
SKILL.md
---
name: csv-data-cleaner
description: Profiles and cleans CSV/Excel data with pandas - types, missing values, duplicates, inconsistent categories and outliers - and reports every change. Use when the user shares a CSV or spreadsheet and asks to clean, normalise, dedupe or prepare it for analysis.
---
# CSV Data Cleaner
## 1. Profile first, change nothing
```python
import pandas as pd
df = pd.read_csv(path, dtype=str, keep_default_na=False)
print(df.shape); print(df.head(10))
for col in df.columns:
print(col, df[col].nunique(), (df[col] == '').sum())
```
Report: rows, columns, empty counts, columns that look like dates/numbers/IDs, and suspected duplicates.
## 2. Clean (ask before dropping data)
1. Trim whitespace; normalise empty strings, `N/A`, `null`, `-` to missing.
2. Convert types explicitly: `pd.to_numeric(errors='coerce')`, `pd.to_datetime(errors='coerce', utc=True)`; list the values that failed to convert.
3. Standardise categories (case, spelling variants) through an explicit mapping table shown to the user.
4. Duplicates: exact first; near-duplicates only on a key the user confirms.
5. Outliers: flag with IQR, don't delete.
## 3. Deliver
- `cleaned.csv` plus a change log: step → rows affected → example before/after.
- Never overwrite the original file.