29 AI Prompts for Data Cleaning

The best Data Cleaning prompts in the Data Analysis library. Tested on ChatGPT, Claude, Gemini and every major model.

Browse the prompts

{
  "model": "jev-latest",
  "state": {
    "today": "{{today-iso-date}}",
    "document": "{{document-text}}"
  },
  "questions": {
    "mode": {
      "type": "choice",
      "instructions": "How is the {{date-role}} written in the document?",
      "criteria": {
        "absolute": "A calendar date that names a month",
        "relative": "Given relative to today, such as tomorrow or next Friday",
        "none": "The document does not state this date"
      }
    },
    "month": {
      "type": "choice",
      "instructions": "If the {{date-role}} is an absolute calendar date, which month is it in?",
      "criteria": {"january": "January", "february": "February", "march": "March", "april": "April", "may": "May", "june": "June", "july": "July", "august": "August", "september": "September", "october": "October", "november": "November", "december": "December", "none": "Not an absolute 

Date Extraction Without Letting the Model Do Math

Extracts specified dates from text documents without performing mathematical operations.

157
Stage one request, top level of the taxonomy:

{
  "model": "jev-latest",
  "state": {
    "product": {
      "title": "{{product-title}}",
      "description": "{{product-description}}",
      "attributes": "{{product-attributes}}"
    }
  },
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which top-level department best matches this product? Read the subtree contents in each option before choosing.",
      "criteria": {
        "{{department-a}}": {"what": "{{department-a-description}}", "examples": ["{{department-a-examples}}"]},
        "{{department-b}}": {"what": "{{department-b-description}}", "examples": ["{{department-b-examples}}"]},
        "other": {"what": "Fits none of the departments listed"}
      }
    }
  }
}

Stage two request, built in code from the chosen department's children, same state, one question:

"subcategory": {
  "type": 

Two-Stage Product Category Assignment

Generate department and subcategory classifications for products using a two-stage hierarchy traversal. Produces JSON output for integration.

80

Data Validation Framework Generator

Generates systematic data validation logic and quality assessment frameworks that verify integrity across completeness, accuracy, consistency, timeliness, and referential integrity dimensions. Runs on ChatGPT, Claude, Gemini, and Grok.

71

Identify Statistical Outliers Using Tukey's Fences

Generates code and boundary calculations that detect statistical outliers in numeric datasets using the Tukey's fences method (Q1 - 1.5ƗIQR, Q3 + 1.5ƗIQR). Runs on ChatGPT, Claude, Gemini, and Grok to produce commented code, a boundary summary table, an outlier report with row positions, and decision guidance for treatment.

55

Remove Duplicate Rows – Python Pandas Data Cleaning

Generates executable Python code that detects, analyzes, and removes duplicate records from datasets using pandas. Runs on ChatGPT, Claude, Gemini, and other text models.

55
## Role
You are an expert data analyst specializing in exploratory data analysis and systematic dataset filtering using pandas.

## Task
Help the user filter dataset rows based on specific conditions. Write clean, readable pandas code using boolean indexing that reveals meaningful patterns and supports iterative exploration.

## Context
The user will describe their dataset structure (columns, data types, size), the filtering criteria they want to apply, their analysis goal, and their pandas experience level. Your code should be educational and easily modifiable for future variations.

## Output
Provide:

1. **Clarifying questions** (if critical details are missing)
2. **Filtering code** – well-commented pandas boolean indexing with clear logic
3. **Impact summary** – before/after row counts quantifying each filter's effect
4. **Sample results** – representative filtered rows demonstratin

Filter Dataset Rows With Pandas Boolean Indexing

Generates clean, commented pandas code that filters dataset rows by specific conditions, returning before/after counts, sample results, and pattern insights. Runs on ChatGPT, Claude, Gemini, and Grok.

53
## Role
You are an expert data scientist specializing in data structure inspection following tidy data principles: each variable forms a column, each observation forms a row, and each type of observational unit forms a table.

## Task
Perform a comprehensive data structure inspection that reveals the complete anatomy of a dataset through systematic code-based analysis.

## Context
Dataset format: {{dataset-format}}
Programming language: {{programming-language}}
Analysis goals: {{analysis-goals}}

## Process
1. **Confirm the dataset** - Request upload/path and verify format compatibility
2. **Structural foundation** - Generate code to examine dimensions, column names, data types, and memory usage
3. **Missing value analysis** - Calculate non-null counts and missing data patterns across all variables
4. **Representative sampling** - Extract and display head, tail, and random samples to ide

Data Structure Inspection Prompt for Python and R

Generates executable code and analysis to reveal dataset dimensions, column types, missing values, and data quality issues. Runs on ChatGPT, Claude, Gemini, and Grok for text-based output.

49

CSV Deduplication Workflow

Guides users through automated CSV deduplication using composite keys, fuzzy matching, and systematic analysis. Runs on ChatGPT, Claude, and Gemini to deliver clean datasets with audit trails.

45

CSV Merger Code Generator Prompt

Generates executable code to merge multiple CSV files with inconsistent structures while preserving data integrity and following Tidy Data principles. Runs on ChatGPT, Claude, Gemini, and Grok.

45
## Role
You are a pandas memory optimization specialist. Analyze DataFrames to identify type mismatches, implement safe conversions, and reduce memory footprint without corrupting data integrity.

## Task
Transform the user's DataFrame into a type-optimized structure by:

1. **Profiling** current memory usage and data types
2. **Identifying** optimization opportunities:
   - Object columns that should be category dtype (< 50% unique values)
   - Strings that should be datetime64
   - Numeric columns using oversized int/float types
3. **Converting** types safely:
   - Category dtype for low-cardinality data
   - Appropriate int8/16/32/64 or float16/32/64 based on value ranges
   - Nullable integer types (Int8, Int16, etc.) for columns with NaN
   - datetime64 with proper format parsing
4. **Validating** all conversions:
   - Check for data truncation in numeric downcasting
   - Verify no 

Optimize DataFrame Memory Usage Prompt

Generates Python code to reduce pandas DataFrame memory footprint through intelligent type conversion and downcasting while preserving data integrity. Runs on ChatGPT, Claude, Gemini, and Grok.

43
## Role

You are a data standardization architect specializing in survey psychometrics. Your expertise lies in reconciling inconsistent Likert-scale feedback data across educational institutions while preserving measurement integrity and historical context.

## Task

Build a comprehensive standardization script that unifies Likert-scale feedback from multiple course surveys with different scales, labels, and formats. The solution must handle real-world complexity: 3-point through 10-point scales, custom variations, text labels, mixed formats, and years of historical data—all while respecting departmental differences and preserving original intent.

## Context

{{survey-landscape}}

The script must:
- Auto-detect scale types from data patterns (3-point, 5-point, 7-point, 10-point, custom)
- Map text labels ("Strongly Agree") to standardized numeric values
- Create reversible transformatio

Survey Feedback Standardization Script Builder

Generates a complete data standardization script that unifies Likert-scale feedback across multiple survey formats, including auto-detection, mapping logic, and audit trails. Runs on ChatGPT, Claude, Gemini, and Grok.

41

Export Cleaned Data to CSV Prompt

Generates production-ready Python code to export cleaned pandas DataFrames to CSV with UTF-8 encoding, error handling, and integrity verification. Runs on ChatGPT, Claude, Gemini, and Grok.

39

Data Cleaning Process Plan Generator for Education

Generates a structured data cleaning process plan in a five-column table format, covering data sources, types, cleaning steps, validation methods, and expected outcomes for educational institutions. Runs on ChatGPT, Claude, Gemini, and Grok.

39

Merge Two Dataframes Using Relational Principles

Guides you through an 8-phase interactive process to merge two datasets correctly, teaching why certain joins preserve or destroy critical information based on relational database principles. Runs on ChatGPT, Claude, Gemini, and Grok.

36
## Role
You are a data validation expert specializing in educational research data management.

## Task
Develop a systematic refinement plan to enhance accuracy and consistency in the institution's research data validation processes. Analyze current workflows, identify concrete improvements, and project measurable outcomes.

## Context
{{institution-and-research-context}}

Address common validation challenges including inconsistent data entry, missing values, outlier detection, quality control gaps, and data integrity weaknesses. Consider data collection methods, validation checkpoints, and automated quality assurance measures appropriate to the research domain.

## Output
Present your refinement plan as a markdown table with three columns:

| Current Process | Potential Improvements | Expected Outcomes |
|-----------------|------------------------|-------------------|

Include 6–8 rows 

Data Validation Refinement Plan for Research

Generates a systematic refinement plan to improve accuracy and consistency in research data validation workflows. Outputs a markdown table covering the full validation lifecycle, designed for ChatGPT, Claude, and Gemini.

36
## Role

You are a data cleaning specialist who diagnoses missing data patterns, evaluates handling strategies against data integrity constraints, and implements pandas-based solutions.

## Task

Guide the user through missing data handling in four phases:

**Phase 1: Pattern Discovery**
Analyze the dataset and generate missing data visualizations (heatmaps, correlation plots, percentage summaries) to reveal missingness patterns.

**Phase 2: Strategy Recommendation**
Present relevant strategies with trade-offs:
- **Drop**: When <5% missing, random patterns; shows row/data loss
- **Forward/Backward Fill**: For time series; shows temporal assumptions
- **Mean/Median Imputation**: For numerical MCAR; shows variance reduction risk
- **Mode/Constant Fill**: For categorical; shows artificial pattern risk
- **Hybrid/Conditional**: For complex patterns; shows group-specific logic
- **Interpolati

Missing Data Analysis and Handling Prompt

Generates a four-phase guided workflow for diagnosing missing data patterns, recommending imputation strategies, and implementing pandas-based solutions with before/after validation. Runs on ChatGPT, Claude, and other text models.

34

Data Quality Improvement Plan Generator for Education

Generates a structured plan to improve data quality checking methods and analytics processes for educational institutions, delivered as a markdown table comparing current methods, proposed improvements, and expected benefits. Runs on ChatGPT, Claude, Gemini, and Grok.

33

Load Dataset With Pandas Prompt for ChatGPT

Generates a four-phase guided workflow that walks users through robust pandas data loading, automatically handling encoding detection, delimiter inference, and common file format issues. Runs on ChatGPT, Claude, Gemini, and Grok.

32
## Role
You are an expert data documentation specialist creating comprehensive dataset descriptions following Timnit Gebru's "Datasheets for Datasets" framework to promote transparency and responsible AI usage.

## Context
Thorough dataset documentation prevents ethical harms like biased hiring algorithms, discriminatory lending practices, and flawed medical diagnoses. Your documentation must uncover hidden biases, unstated assumptions, and gaps in representation that users must understand before deployment.

## Task
Create a complete datasheet covering the six core framework areas:

1. **Motivation** – Who created this dataset and why? What problem does it address? Who funded it?
2. **Composition** – What data is included and excluded? What do instances represent? How many instances? Are there missing values, errors, or confidential data?
3. **Collection Process** – How was data gathere

Draft Dataset Descriptions Following Datasheets Framework

Generates comprehensive dataset documentation following Timnit Gebru's "Datasheets for Datasets" framework to promote transparency and responsible AI usage. Runs on ChatGPT, Claude, Gemini, and Grok to produce structured text documentation covering motivation, composition, collection, preprocessing, intended uses, and known limitations.

30
You are a senior data analyst who translates raw data into clear business insights for non-technical stakeholders.

# Your Task

Analyze the dataset provided below and deliver a comprehensive yet accessible report structured in three parts:

## 1. Dataset Overview
Describe what this data represents: the domain, time period, key metrics captured, and the business or research context it serves. Identify the grain of the data (what each row represents) and note any data quality observations (completeness, obvious gaps, or anomalies).

## 2. Key Questions This Data Can Answer
Generate 4-6 high-value questions stakeholders should ask of this dataset. Prioritize questions that:
- Drive decisions or reveal opportunities
- Address trends, patterns, comparisons, or outliers
- Align with common business objectives (growth, efficiency, risk, customer behavior)

Frame each question in plain language

Data Analyst

Generate a comprehensive data analysis report focusing on actionable insights and business value from a provided dataset.

29

Lead Data Analyst for Actionable Insights

Generate a complete plan for a data project, focusing on actionable insights and visualization using Python and dashboards.

28

Clean Column Names for Pandas DataFrames

Transforms messy DataFrame column names into clean, lowercase, underscore-separated identifiers following Python best practices. Runs on ChatGPT, Claude, Gemini, and Grok with transparent before/after comparisons and production-ready code.

27

Reshape Wide-Format Data to Long-Format Prompt

Generates step-by-step guidance and executable code to reshape wide-format datasets into long (tidy) format using melt transformations. Runs on ChatGPT, Claude, Gemini, and Grok, adapting to your programming environment (Python, R, SQL).

24
You are a Lead Data Analyst with a strong Data Engineering foundation. You bridge the gap between raw data infrastructure and business intelligence, delivering end-to-end solutions that are technically sound and strategically aligned.

# Context
You will receive a data challenge or dataset description. Your role is to transform ambiguous requests into structured, actionable data solutions.

## Business Problem
{{business-problem}}

## Available Data Context
{{data-context}}

---

# Your Approach

Follow this end-to-end methodology:

## 1. Clarify the Business Question
- Restate the core objective in measurable terms
- Identify key stakeholders and their success metrics
- Surface any hidden assumptions or constraints
- Flag ambiguities that need resolution before proceeding

## 2. Design the Data Solution

### Data Collection
- Identify optimal data sources (databases, APIs, logs, third-p

Lead Data Analyst with Data Engineering Expertise

Generate end-to-end data solutions by transforming raw data into actionable business intelligence. This prompt is designed for data analysts and engineers aiming to solve complex data challenges.

21

What are AI prompts for Data Cleaning?

AI prompts for Data Cleaning are engineered instructions that already work. These are not one-line questions. Each one fixes the role, the context, the task and the output format before you type a word, so you get a usable result on the first run instead of the fourth.

They cover the work Data Cleaning actually get asked for: research and briefs, copy and content, analysis and reporting, planning, outreach and the admin that eats the day. Open a card to see the full prompt and the output it returns.

Popular on this page right now: "Date Extraction Without Letting the Model Do Math", "Two-Stage Product Category Assignment", "Data Validation Framework Generator".

29 on this page, every one scoped to Data Cleaning. Free to read, free to copy.

Why these prompts work for Data Cleaning

A weak prompt costs you the hour you were trying to save: you rewrite it three times, get something generic, then finish the job by hand. An engineered prompt front-loads that thinking once.

In Data Cleaning that means first drafts you can send, analysis you can act on, and the repetitive work handed off, so the time goes into judgement instead of typing.

Every prompt here was written for a real job and tested against the models people actually use. Nothing scraped from a thread.

How to use these prompts

Open a prompt, copy it, and replace the [bracketed] variables with your own product, audience or topic. The structure around them stays as is. That structure is the part doing the work.

Paste it into ChatGPT, Claude, Gemini, Grok or the model you already use. If the output drifts, tighten the context line instead of rewriting the whole prompt.

No account needed to copy one. No setup, no extension, nothing to install.

Which AI tool works best for Data Cleaning prompts?

Text prompts here run well in ChatGPT, Claude, Gemini and Grok; image prompts target Midjourney and Nano Banana. Each card lists the models it was tested with.

Are these AI prompts free to use?

A big part of the library is free: open a prompt, copy it, use it. Premium packs and the Complete AI Bundle unlock the full collection with lifetime updates.

How do I adapt these prompts to my use case?

Start with the [variables]: niche, audience, constraints. If the result still misses, add one example of the output you want. A single good example beats three extra instructions.

For a prompt built from scratch, the Start Now card above opens the custom prompt generator.

Related resources

Get smarter on AI every week

One email a week with the best new prompts, tools, and model updates. Unsubscribe anytime.

Join 100,000+ subscribers. One email a week, real prompts, tools, and model updates. Unsubscribe anytime.

About Data Cleaning prompts

Data cleaning prompts prepare a dataset for analysis: an assessment of what is wrong with an export, a cleaning plan in order with the rule for each issue, the code to apply it in Python, R or a spreadsheet, a deduplication strategy with the matching rules, a standardisation of names, dates and categories, a validation check after cleaning, a log of what was changed. They ask for a sample of the data and its intended use, and they never silently drop or alter rows without a rule you approved.

Analysts use them on every new source. Operations teams use them on CRM and product exports. Researchers use them on survey data. The prompts treat cleaning as a documented process rather than a one-off, so the same rules run on next month's export, and they flag the decisions a human must make, such as which duplicate to keep. Paste the messy sample with the headers; the plan is written against what it shows.