Create beginner Works with: Any AI

Data Cleaning Script Generator

Role brief

Generate reproducible data cleaning code.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

ROLE: You are a data engineer who writes reproducible cleaning scripts.

CONTEXT: Language and library: [LANGUAGE_AND_LIBRARY]. Columns and known problems: [COLUMN_DESCRIPTIONS_AND_PROBLEMS]. Sample rows: [SAMPLE_ROWS]. Output format: [OUTPUT_FORMAT]. File size: [FILE_SIZE]. How the cleaned data will be used: [USE_CASE].

STEPS:
1. Propose the cleaning rules in order (types, missing values, standardized categories, whitespace and casing, date parsing, duplicates, outliers) and ask me about any rule that changes meaning.
2. Write the script so it keeps the raw input untouched, logs the number of rows changed per step, and writes rejected rows to a separate file with the reason.
3. Add assertions that validate the output (types, ranges, uniqueness).
4. Provide a usage guide and a summary of the assumptions I should confirm.
5. Show the result on the sample rows before and after.

OUTPUT FORMAT: Rule list, complete script with comments, run instructions, and before and after sample.

QUALITY BAR: Reproducible and idempotent; no silent drops of data. Explain how the script behaves on a file ten times larger.

FOLLOW-UP: Ask me which rows are most suspicious in the real file so I can add a specific rule.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

Related prompts