When to use it

Use this prompt when you receive an export from a CRM, a survey tool, a spreadsheet maintained by several people or a public dataset, and you need to make it usable. It helps you see the problems before you start editing, so you clean the data on purpose instead of by trial and error.

How to customize it

  • [SHORT DESCRIPTION] gives the model context to infer what each column means.
  • [WHAT I WILL USE IT FOR] decides what “clean” means. A dashboard needs consistent categories; a machine learning model also needs careful handling of missing values and outliers.
  • [ROWS AND COLUMNS] helps the model judge whether its code needs to be memory-efficient.
  • [TOOL] sets the language of the code in step 4.
  • [HEADER + ROWS] is the evidence. Include deliberately messy rows, not only the first 20, which are often the cleanest.

Why it works

The prompt separates diagnosis from treatment. Profiling first, then planning, then coding mirrors how experienced data engineers work and makes each stage reviewable. The ordered plan with an estimate of affected rows makes the consequences of each step visible.

The “Decisions for me” step is a deliberate constraint: many cleaning choices are business decisions, not technical ones, and a model should not make them silently. Logging rows changed per step and keeping the original file are safeguards that make the cleaning reproducible and auditable. The final instruction about unseen rows reminds both you and the model that a sample cannot reveal every problem.

Tips and variations

  • Remove or mask personal data before pasting rows. Fake but realistic values are enough to show format problems.
  • If your assistant can run code and accepts file uploads, upload the full file and ask it to run the profile on all rows, then compare with the sample-based plan.
  • Ask for the checks in step 5 as automated assertions so you can rerun them on next month’s export.
  • For recurring exports, finish with: “Turn this into a reusable function with parameters.”
  • See our guide on preparing a dataset for fine-tuning if the cleaned data will be used to train a model.