Example result: Plan how to clean a messy dataset
AI-generated example · Data Cleaning
Updated

Plan how to clean a messy dataset

This prompt acts as a data analyst. You describe the dataset and the problems you see, such as duplicate rows, missing values or mixed date formats, and it lays out a cleaning plan in order.

text-data-cleaning-plan — chatgpt — 63 words

Act as a data analyst. Help me clean this dataset.

Dataset description: [WHAT IT CONTAINS]
Columns and problems I see: [e.g. duplicate rows, missing values, mixed date formats]
Tool: [PYTHON PANDAS / EXCEL / SQL]

Give a step-by-step cleaning plan in the order I should do it, with code for each step, checks to confirm it worked and what to document for others.

Keep the raw file untouched and clean a copy.

Get a better result

What you will get

A step-by-step cleaning plan in the right order, with code for each step in your chosen tool, a check after each step and notes on what to document for the next person.

Common mistake

You clean the original file and cannot go back.

Fix: Follow the tip: keep the raw file untouched, work on a copy and save each stage with a clear name.

Also watch for
  • The plan deals with problems you did not mention, or misses real ones. Paste ten sample rows, including odd ones, and ask “what other problems do you see in this sample?” before you run any code.
  • Rows are dropped without a record of how many. Ask for a row count before and after every step and a note of what was removed, so you can explain the final number.
Try a variation: make it repeatable

Ask for “turn the steps into one script I can rerun on next month’s file, with the same checks and a log”. It saves time on a regular report.

Still not right? Reply with this

Add a final validation step that checks no duplicates remain, the date column has one format and the missing values are listed by column.

Guides that use this prompt

More chat & writing prompts

See all 465 →