Data Cleaner: Messy CSV & Excel to Tidy Data
by Ignasi
Profile, clean, and deduplicate messy CSV/Excel data with a reproducible Python script and detailed change logs.
Free
Data Cleaner: Messy CSV & Excel to Tidy Data
Example session with this skill installed
I have a messy customers.csv with weird dates, duplicate names like 'BCN' vs 'Barcelona', and European price formats. Profile it and give me a cleaning plan.
- Read your context and instructions
- Compiled the data cleaner
- Generated the data export
I have profiled customers.csv. The file contains 1,240 rows with 8 columns. I detected latin-1 encoding and a semicolon delimiter. Column price uses a comma decimal separator (e.g., 1.250,50). Column city has 4 variants for Barcelona and 3 for Madrid.
Data Cleaning Plan
| Step | Transformation | Detail |
|---|---|---|
| 1 | Header Normalisation | Convert headers to snake_case (e.g., 'Customer Name' -> customer_name). |
| 2 | Type Casting | Convert price to float by removing . and replacing , with .. |
| 3 | Date Standardisation | Parse signup_date using dayfirst=True to ISO YYYY-MM-DD. |
| 4 | Categorical Mapping | Map 'BCN', 'barcelona ', 'Barcelona' to 'Barcelona'. |
| 5 | Deduplication | Fuzzy match customer_name + email with a 90% threshold. |
| 6 | Validation | Ensure customer_id is unique and email follows E.164 format. |
Reproducible Cleaning Script
import pandas as pd
import numpy as np
from rapidfuzz import process, utils
def clean_data(filepath):
# Load with detected settings
df = pd.read_csv(filepath, sep=';', encoding='latin-1')
# 1. Headers
df.columns = [c.lower().strip().replace(' ', '_') for c in df.columns]
# 2. Prices (European format)
df['price'] = df['price'].str.replace('.', '').str.replace(',', '.').astype(float)
# 3. Dates
df['signup_date'] = pd.to_datetime(df['signup_date'], dayfirst=True).dt.strftime('%Y-%m-%d')
# 4. City Normalisation
city_map = {'BCN': 'Barcelona', 'barcelona ': 'Barcelona'}
df['city'] = df['city'].replace(city_map)
return df
if __name__ == "__main__":
cleaned_df = clean_data('customers.csv')
cleaned_df.to_csv('customers_clean.csv', index=False)
print("Cleaning complete. 1,240 rows processed.")
Next steps
- Confirm the categorical mapping for
cityvariants. - Specify if you want outliers in the
pricecolumn flagged or moved torejected_rows.csv. - Run the provided script locally to generate the final
customers_clean.csv.
customers.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Dirty data ruins analysis and breaks imports. This skill takes messy CSV, Excel, or JSON files and transforms them into tidy, validated datasets while generating a reproducible Python script for your pipeline.
What it does
- Data profiling scans every column to detect encoding, mixed types, unique counts, and anomalies before touching a single row.
- Normalisation fixes headers to snake_case, strips whitespace, corrects encoding mojibake, and standardises categorical variants.
- Locale-aware parsing handles complex number formats like European decimals and ambiguous date formats into ISO standard.
- Deduplication performs exact and fuzzy matching with confidence scoring to catch duplicate records without silent data loss.
- Validation and logging generates a change log and a rejected_rows file so you can audit every transformation and reconcile row counts.
How it works
- Profile: The agent analyzes your file and reports on null percentages, data types, and potential issues like empty rows.
- Plan: It presents a numbered cleaning plan tailored to your target (e.g., CRM import vs. financial analysis) for approval.
- Clean: Once confirmed, it applies transformations including type casting, outlier flagging, and categorical mapping.
- Export: It delivers the cleaned data, a list of rejected rows, and a standalone Python script for future use.
Frameworks & tools
Uses pandas or polars for processing, ftfy for text encoding fixes, and rapidfuzz for high-performance fuzzy matching.
Why this beats prompting it yourself
Generic prompts often hallucinate data or silently delete rows when they encounter parsing errors. This skill follows a rigorous multi-step protocol that ensures row count reconciliation and provides the actual Python code so you aren't locked into an AI black box.
Use cases
- Preparing messy marketing exports for a CRM or database import.
- Standardising financial spreadsheets with inconsistent date and currency formats.
- Cleaning user-generated data for machine learning model training.
- Merging disparate lists with fuzzy name and address matching.
Known limitations
The skill handles files within your context window limits. For extremely large datasets, it provides the cleaning script to run locally rather than processing the entire file in-session.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 11 days ago
- Free with an Agensi account
Permissions
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.