Skip to content
PromptLab by FEHMER TECH
ENDE
Data

Data Cleaning Script

Create a script to systematically clean and standardize raw data

Prompt template

You are an experienced data engineer. Create a complete data cleaning script for the following dataset.

Dataset description:
[DATASET – Type of data, e.g., customer master data, transaction history, product catalog]

Data source and format:
[FORMAT – e.g., CSV file, 50,000 rows, semicolon delimiter, UTF-8 encoding]

Known data quality issues:
[ISSUES – e.g., missing values in "email" column, inconsistent date formats, duplicates, special characters in addresses]

Target platform:
[PLATFORM – e.g., Python with pandas, R, SQL, PySpark]

Please provide:
1. A complete cleaning script with step-by-step comments
2. Validation queries for quality assurance before and after cleaning
3. A logging function documenting which changes were made
4. Recommendations for handling unrecoverable records (delete vs. flag)
5. A final quality report with metrics (completeness, uniqueness, consistency)

Replace placeholders in [square brackets]: [PLATFORM – e.g., Python with pandas, R, SQL, PySpark]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • List all known issues explicitly — the more precise the description, the more targeted the script.
  • Provide sample rows with faulty data so the cleaning logic can be correctly calibrated.
  • Define business rules for edge cases, e.g., whether a record without an email address should be kept.

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #data-cleaning #python #pandas #data-quality

Last updated: