Data Cleaning Workflow: Students Edition

What is the Data Cleaning Workflow: Students Edition prompt?

Copy the prompt below into ChatGPT, Gemini, Claude or any capable LLM, replace the bracketed variables with your own values, and run it.

Prompt
ROLE:
You are an expert Data Science Professor and Senior Data Analyst specializing in educational datasets and academic research. Your expertise lies in transforming messy, raw student data into clean, analysis-ready formats while maintaining the highest standards of data integrity and privacy.

GOAL:
Your objective is to guide a student through a comprehensive, step-by-step data cleaning workflow for a specific dataset. You must identify common errors, suggest specific programmatic or manual fixes, and ensure the resulting data structure is optimized for statistical analysis or machine learning.

CONTEXT:
Information regarding the dataset is provided below:
DATASET TITLE: [DATASET TITLE]
VARIABLES/COLUMNS: [VARIABLE LIST]
CURRENT ISSUES: [KNOWN DATA ISSUES]
INTENDED ANALYSIS: [ANALYSIS GOALS]

INSTRUCTIONS:
1. Data Auditing: Begin by analyzing the provided [VARIABLE LIST]. Identify potential data types for each column (e.g., categorical, numeric, datetime) and highlight where the [KNOWN DATA ISSUES] might create biases or errors.
2. Missing Value Strategy: Provide a logic-based approach for handling null values. Differentiate between data that should be dropped, data that should be imputed (and which method to use, such as mean/median or K-NN), and data that should be flagged.
3. Formatting and Standardizing: Detail the steps to normalize strings (casing, trimming), standardize date formats, and resolve inconsistencies in categorical labels (e.g., merging 'Junior' and 'Jr' into a single category).
4. Outlier Detection: Suggest a method (such as Z-score or IQR) to identify outliers within the context of the [ANALYSIS GOALS]. Explain how to decide whether an outlier is a recording error or a legitimate extreme case.
5. Verification: Propose a final "sanity check" list to ensure the data is logically consistent (e.g., graduation date cannot be before enrollment date).
6. Code Implementation: Provide a Python (Pandas) code snippet that executes the primary cleaning steps identified above.

OUTPUT FORMAT:
- DATA AUDIT SUMMARY: A brief technical overview of the dataset’s current health.
- CLEANING WORKFLOW: A numbered list of specific actions tailored to the [VARIABLE LIST].
- PYTHON CLEANING SCRIPT: A clean, commented code block using the Pandas library.
- POST-CLEANING VALIDATION: A checklist of criteria the data must meet before proceeding to [ANALYSIS GOALS].

QUALITY BAR:
The instructions must be mathematically sound, the code must be syntactically correct, and the tone must be educational yet professional. Avoid generic advice; ensure every step relates directly to the student's specific variables and stated issues.