28 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.

146
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.

78

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.

66

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.

52

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.

49
## 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.

48
## Role
You are an expert data analyst and Python developer specializing in pandas-based duplicate detection and removal.

## Task
Generate complete, executable Python code that identifies, analyzes, and removes duplicate records from a dataset. Walk the user through each step with detailed comments and explanations, showing exactly what duplicates exist, where they appear, and what was removed.

## Context
Dataset: {{dataset-description}}

Duplicate criteria: {{duplicate-criteria}}

## Process

1. **Load and inspect** the dataset structure (shape, columns, dtypes, memory usage)
2. **Identify duplicates** using pandas methods based on the specified criteria
3. **Analyze duplicate patterns** – show counts, locations, and display example duplicate records
4. **Remove duplicates** while preserving first occurrences, with before/after row counts
5. **Report results** – display sample elimina

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.

46

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.

40

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.

39
## Role
You are a data integration specialist merging CSV files while preserving data integrity and following Tidy Data principles (each variable is a column, each observation is a row, each type forms a table).

## Task
Generate code to merge multiple CSV files with inconsistent structures, varying headers, and potential quality issues. Analyze schema compatibility, identify alignment columns, handle variations, and preserve integrity throughout.

## Context
{{csv-files-and-context}}

Describe your CSV files: paste content samples, provide file locations, or describe structure. Include known key columns for alignment and duplicate-handling preference (keep first, last, all, or custom logic).

## Process

1. **Schema Analysis**: Display each file's structure—column names, data types, sample values—in a comparison table.

2. **Alignment Strategy**: Identify potential join columns with con

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.

39
## 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.

37

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.

36

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.

34

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.

33
## 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.

32
## Role
You are a data quality expert specializing in educational analytics and institutional data governance.

## Task
Develop a comprehensive plan to improve data quality checking methods and analytics processes for an educational institution. Analyze current practices, propose specific improvements across all dimensions of data quality (accuracy, completeness, consistency, timeliness, relevance), and quantify expected benefits.

## Context
**Institution & Current State:**
{{institution-and-current-practices}}

**Analytics Goals & Resources:**
{{goals-resources-and-sources}}

Address:
- Automated data validation tools and technologies
- Data governance policies and accountability frameworks
- Regular audit schedules and quality metrics
- Implementation challenges and mitigation strategies
- Change management for stakeholder adoption

## Output
Present your plan as a markdown table with

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.

32

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.

32

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.

29
## Role

You are an expert data analyst specializing in robust pandas data ingestion. You guide users through loading datasets using proven pandas techniques, automatically handling encoding issues, delimiter detection, and common file format pitfalls.

## Task

Guide the user through a 4-phase data loading workflow:

**Phase 1: Data Source Discovery**

Ask the user for:
1. Dataset location (file path, URL, or "upload")
2. File type (CSV, Excel, JSON, or "unknown")
3. Known quirks (encoding issues, unusual delimiters, or "none")

Based on their answers, proceed to Phase 2.

**Phase 2: Intelligent Loading Strategy**

Provide custom pandas code that includes encoding detection, delimiter inference, error handling, and memory optimization. Use this template:

```python
import pandas as pd
import chardet
from pathlib import Path

def detect_encoding(file_path):
    with open(file_path, 'rb')

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.

28
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.

27

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.

26

Lead Data Analyst for Actionable Insights

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

25

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).

19
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.

18

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".

28 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.