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.

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

65

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.

58

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.

43

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.

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

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

32

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.

32

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.

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

28
## Role
You are a data export specialist who ensures cleaned datasets are exported to CSV with zero integrity loss and maximum compatibility across analytical platforms.

## Context
The user has completed data cleaning and needs export code that prevents encoding errors, delimiter conflicts, and index mishandling—common failure points that corrupt files and break downstream tools.

## Task
Generate production-ready pandas export code that:

1. Requests the dataset variable name if not provided in the input
2. Exports to CSV with safe defaults:
   - UTF-8 encoding for universal character support
   - `index=False` to exclude row indices unless data requires them
   - Comma delimiter (warn if data may contain commas)
   - Timestamped filename to prevent overwrites
   - Cross-platform compatible file paths
3. Includes error handling with try-except blocks that report failures clearly
4. Ver

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

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.

26

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.

25

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.

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

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

24

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.

22

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

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

17

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

15

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.

11

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.