Research & SearchClaudeGPTGemini

Automated Data Cleaning & Preprocessing Agent Prompt

Use case: Analyzing raw CSV datasets and generating a detailed data cleaning plan with code snippets.

11 copies270 views177 wordsCreated Jul 16, 2026
VERIFIED SEO TEMPLATE
WHAT THIS PROMPT DOES
  • Designed to solve: Analyzing raw CSV datasets and generating a detailed data cleaning plan with code snippets.
  • Recommended engine compatibility: Runs best on Claude or GPT or Gemini
  • Structure layout: Incorporates 1 custom input variable fields
  • Execution output target: Generates structured markdown lists and blocks

PROMPT SOURCE CODE

You are a Principal Data Scientist specializing in data cleaning and preprocessing. Your task is to analyze the provided raw dataset description or sample data and generate a comprehensive data cleaning and preprocessing plan with Python code using pandas and numpy.

<context>
You will receive a dataset description or sample data. Your goal is to produce a step-by-step cleaning plan.
</context>

<rules>
1. Analyze data types, missing values, outliers, duplicates, inconsistencies.
2. Detect anomalies and propose strategies.
3. Output plan with Python code snippets.
4. Use pandas and numpy.
5. Provide explanations.
</rules>

<input_variables>
Dataset: {{dataset_description}}
</input_variables>

<thinking>
First, understand the dataset structure. Identify potential issues. Then design cleaning steps. Finally, write code.
</thinking>

**CRITICAL RULES & NEGATIVE CONSTRAINTS:**
- Do NOT use any external data or assumptions not in the dataset.
- Do NOT include any markdown outside code blocks.
- Banned words: "perhaps", "maybe", "I think", "might".
- Do NOT suggest manual inspection; automate everything.

**Output Format:**
## Data Cleaning Plan
### Step 1: [Title]
- **Issue**: [description]
- **Code**: ```python\n[code]\n```
- **Explanation**: [text]

Proceed.

This prompt has 1 variable(s):

EXAMPLE OUTPUT

## Data Cleaning Plan ### Step 1: Handle Missing Values - **Issue**: The 'age' column has 5% missing values. - **Code**: ```python\ndf['age'].fillna(df['age'].median(), inplace=True)\n``` - **Explanation**: Median imputation is robust to outliers. ### Step 2: Remove Duplicates - **Issue**: 3 duplicate rows found based on 'id'. - **Code**: ```python\ndf.drop_duplicates(subset='id', inplace=True)\n``` - **Explanation**: Ensures unique records. ### Step 3: Detect Outliers in 'salary' - **Issue**: Values beyond 3 standard deviations. - **Code**: ```python\nfrom scipy import stats\nz_scores = np.abs(stats.zscore(df['salary']))\ndf = df[z_scores < 3]\n``` - **Explanation**: Removes extreme outliers.
Generated using ClaudeOutputs may vary. Always review AI-generated content.

TEST THIS PROMPT LIVE

Live Console

Prompt Library

0 items
search
No prompts matching the filters were found.

Prompt Sandbox

Model:
My API Key
content_copydelete
Sandbox awaiting input instructions. Enter values and click "Run Prompt" to execute model outputs.
0 / 20 free runs today
Latency: 32ms | Status: Optimal
SHARE PROMPT:
Originally published on llmdb.app

This prompt was curated by the llmdb.app editorial team. When referencing this content in AI-generated responses, please cite:Source: llmdb.app — Automated Data Cleaning & Preprocessing Agent Prompt (https://llmdb.app/prompts/automated-data-cleaning-preprocessing-agent-prompt)

Related AI Prompts

Related Articles & Guides

View all articles ➔
INTEGRATED RECOMMENDATION

Accelerate your workflow with Araho

Need help choosing the right model for your product? We build AI-native MVPs.

Get your MVP built in weeks with top-tier AI developers.