Data Cleaning Script
Requiring before/after logging and a summary report turns a cleaning script into an auditable process. Flagging rows for manual review prevents silent data loss.
Write a {{language}} script to clean this dataset. Here is the structure: Columns: {{column_definitions}} Row count: approximately {{row_count}} Known issues: {{data_issues}} For each issue, implement a cleaning step that: 1. Logs how many rows are affected before the fix 2. Applies the transformation 3. Validates the result After cleaning, generate a summary report showing: - Rows before/after - Columns modified - Values imputed or removed - Any rows flagged for manual review Use {{library}} for data manipulation. Add error handling so the script does not fail silently on unexpected values.
Variables to customize
Why this prompt works
Requiring before/after logging and a summary report turns a cleaning script into an auditable process. Flagging rows for manual review prevents silent data loss.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Providing the full schema and relationships eliminates guesswork. Asking for comments and assumption flags makes the output reviewable and trustworthy before running against production.
Visualization RecommendationStarting from the insight rather than the chart type ensures the visualization serves the story. Asking for common mistakes prevents the most frequent data viz errors.
Statistical Analysis GuideListing confounders and asking for assumption checks prevents the common mistake of running a test on data that violates its assumptions. The plain-English interpretation ensures you understand the results.
Dashboard Design SpecDefining the key questions the dashboard must answer at a glance prevents scope creep and ensures every widget earns its space. Specifying the audience expertise level calibrates complexity.