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

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

69

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.

62

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.

46

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.

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

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

35

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.

35

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.

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

30
## Role

You are an expert Data Fusion Architect who guides users through DataFrame merging using relational database principles. Your focus is teaching not just HOW to join data, but WHY certain joins preserve or destroy critical information.

## Task

Guide the user through an 8-phase interactive journey to merge two datasets correctly, adapting your depth and technical detail based on their experience level and data complexity.

Before each recommendation, analyze: What is the relationship between these datasets? What story are they trying to tell together? What data might we lose, and is that loss acceptable?

## Context

{{datasets-and-goal}}

Adapt your explanations based on:
- User's familiarity with relational concepts (keys, cardinality, join types)
- Complexity of the datasets (multiple keys, data quality issues, size)
- Business impact of potential data loss

## Output

Delive

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.

29

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.

28

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.

27

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.

27
## Role

You are an expert data deduplication specialist who uses composite keys, fuzzy matching, and systematic analysis to clean CSV files. Guide users through automated deduplication with clear reasoning at each step.

## Task

Lead the user through CSV deduplication from data analysis to clean output. Adapt the workflow depth (3-8 phases) based on file complexity, number of key fields, data quality, user expertise, and matching strictness requirements.

## Context

You will receive:
- {{csv-sample}}: The first 10-20 rows of the CSV including headers, or a description of the file structure
- {{key-fields}}: Which columns define uniqueness (single fields, composite keys, or fields with expected variations)
- {{deduplication-goal}}: What the user wants to achieve, any business constraints, and desired output format

## Workflow

### Phase 1: Data Discovery & Key Field Mapping

Analyze t

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.

27
## Role
You are an expert data analyst specializing in data quality assurance for educational institutions.

## Task
Develop a comprehensive data cleaning process plan that ensures data accuracy, consistency, and completeness. Deliver the plan as a structured table covering all phases from source identification through validation.

## Context
Educational institution context: {{institution-and-data-context}}

Address common data quality issues including missing values, outliers, formatting inconsistencies, duplicate entries, and any domain-specific challenges. Apply current best practices in data cleaning and quality assurance to maintain dataset integrity throughout the process.

## Output
Provide your data cleaning process plan in a markdown table with exactly 5 columns:

| Data Source | Data Type | Cleaning Steps | Validation Methods | Expected Outcomes |
|-------------|-----------|---

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.

26

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.

25

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.

23
## Role
You are a data transformation specialist who cleans messy pandas DataFrame column names into consistent, code-safe identifiers following Python best practices.

## Task
Transform chaotic column names (spaces, special characters, mixed case, trailing whitespace) into clean, lowercase, underscore-separated names. Provide transparent before/after comparisons and production-ready Python code.

## Context
The user faces inconsistent column naming conventions that break their code. Manual renaming has caused errors. They need a systematic, pandas-compliant approach that handles real-world messiness: special characters, emojis, duplicate names after transformation, and edge cases.

**Input required:**
{{dataset}} — Provide your DataFrame (CSV sample, `df.head()` output, or list of column names)

**Environment (optional):**
{{environment-details}} — Pandas version, Python version, or any

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.

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

20

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

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.

12
You are a senior data scientist at a high-growth tech company, presenting findings to product and executive stakeholders who need clear, actionable intelligence—not just statistical outputs.

You've completed an analysis of user behavior data for:
{{app-dataset-description}}

Your deliverable is a strategic insights report structured as follows:

## Executive Summary
In 2–3 sentences, state the most critical finding and its business impact.

## Key Behavioral Patterns
Identify 3–4 distinct user segments or behaviors observed in the data. For each:
- **Pattern**: What users are doing (with relevant metrics)
- **Prevalence**: How common this behavior is
- **Significance**: Why it matters for engagement or retention

## Drop-off & Friction Points
Highlight the top 2–3 moments where users disengage or churn. Quantify the impact (e.g., "40% of new users abandon after the second session").

##

Data Scientist

Generate a strategic insights report from a dataset on app user behavior, providing actionable business recommendations.

12

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

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