Write a data cleaning and transformation script for [DATASET DESCRIPTION].
Language: [PYTHON / R / SQL]
Input format: [CSV / JSON / DATABASE TABLE / API]
Output: [CLEAN DATASET / DATABASE / DASHBOARD-READY]
Handle:
1. **Missing Values**: Detection, imputation strategy (mean/median/mode/forward-fill/drop)
2. **Duplicates**: Identification and deduplication rules
3. **Data Types**: Conversion and validation
4. **Outliers**: Detection method and handling (cap, remove, flag)
5. **Standardization**: Date formats, currency, phone numbers, addresses
6. **Text Cleaning**: Whitespace, case, special characters, encoding issues
7. **Validation Rules**: Business logic checks (e.g., end date after start date)
8. **Logging**: Report of what was cleaned, how many rows affected
9. **Output**: Clean dataset with documentation of all transformations
10. **Reproducibility**: Make the script idempotent and configurable
Write a data cleaning and transformation script for [DATASET DESCRIPTION].
Language: [PYTHON / R / SQL]
Input format: [CSV / JSON / DATABASE TABLE / API]
Output: [CLEAN DATASET / DATABASE / DASHBOARD-READY]
Handle:
1. **Missing Values**: Detection, imputation strategy (mean/median/mode/forward-fill/drop)
2. **Duplicates**: Identification and deduplication rules
3. **Data Types**: Conversion and validation
4. **Outliers**: Detection method and handling (cap, remove, flag)
5. **Standardization**: Date formats, currency, phone numbers, addresses
6. **Text Cleaning**: Whitespace, case, special characters, encoding issues
7. **Validation Rules**: Business logic checks (e.g., end date after start date)
8. **Logging**: Report of what was cleaned, how many rows affected
9. **Output**: Clean dataset with documentation of all transformations
10. **Reproducibility**: Make the script idempotent and configurable
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.