Skip to main content
MethodScience & Data AnalysisData analysisStarter

Clean a messy dataset

A data-quality report and step-by-step cleaning plan (with code) that keeps an audit trail.

This is a practical, copy-paste process for before any analysis of spreadsheet or csv data.. Use it when you want a clear structure, then add your own details and the linked evidence.

Published by Deepstory Research. Reviewed Sep 2026.

How to use this method

  1. 1. Copy or downloadCopy the prompt below, or download the method file and attach it to your chat.
  2. 2. Paste into any AIChatGPT, Claude, Gemini or Copilot. Replace each [PLACEHOLDER] with your details, or let the AI ask you.
  3. 3. Add evidenceAttach the evidence files listed on this page so the AI works from sourced numbers, not guesses.

The prompt

Paste it as-is. The AI will ask for anything still in [BRACKETS].

Download .md
# Clean a messy dataset
Method by Deepstory Research: deepstoryresearch.com/method/data-cleaning-plan

You are a data analyst who is careful about provenance. Follow the method below step by step. Goal: A data-quality report and step-by-step cleaning plan (with code) that keeps an audit trail.

## My inputs
- Dataset: [DATASET]  (example: attach CSV/Excel)
- What the data will be used for: [WHAT_THE_DATA_WILL_BE_USED_FOR]  (example: monthly sales dashboard)
- Tool: [TOOL]  (example: Excel, Python or Google Sheets)

Before you start: if any input above is still in [BRACKETS] or missing, ask me for it in one short numbered list and wait. Do not guess. If I attached files (data, briefs, Deepstory evidence files), treat them as the primary source.

## Steps to follow
1. Profile columns: types, missing, duplicates, outliers, inconsistent labels.
2. Propose rules for each issue.
3. Keep a change log.
4. Provide code or formulas.
5. Report what could not be fixed.

## Deliver the output in this structure
- Data-quality report
- Cleaning rules
- Code/formulas
- Change log
- Residual issues

## Quality rules
- Never silently drop rows, count and log them.
- Distinguish zero from missing.
- Label every number as FACT (with source and date), ESTIMATE (show the calculation) or ASSUMPTION.
- If a Deepstory evidence file is attached, use its figures as the reference values and cite its source references; tag claims that are not from it as [UNVERIFIED].
- End with: the 3 assumptions that matter most, what would change the answer, and the single best next step.

What you need to give the AI

InputPlaceholderExample
Dataset[DATASET]attach CSV/Excel
What the data will be used for[WHAT_THE_DATA_WILL_BE_USED_FOR]monthly sales dashboard
Tool[TOOL]Excel, Python or Google Sheets

Use it when

  • Before any analysis of spreadsheet or CSV data.

What you get

  • Data-quality report
  • Cleaning rules
  • Code/formulas
  • Change log
  • Residual issues

The procedure, step by step

Read this before you run it, so you can check the AI actually followed the method.

  1. 1

    Profile columns: types, missing, duplicates, outliers, inconsistent labels.

  2. 2

    Propose rules for each issue.

  3. 3

    Keep a change log.

  4. 4

    Provide code or formulas.

  5. 5

    Report what could not be fixed.

Quality checks built into the prompt

  • • Never silently drop rows, count and log them.
  • • Distinguish zero from missing.
  • • Every number labelled FACT, ESTIMATE or ASSUMPTION; claims outside attached evidence tagged [UNVERIFIED].

Evidence to use with this method

Methods tell the AI how to think. Evidence gives it sourced numbers to think with. Download a context file and attach it with the prompt.

EvidenceGeopolitical

Internet use ranking

Which selected economies reported the highest internet-use rates? Individuals using the Internet (% of population) · common year 2024 · 20 selected economies with published values

EvidenceGeopolitical

Income and internet use

Did higher-income selected economies also report more internet use? GDP per capita (current US$) vs Individuals using the Internet (% of population) · common year 2024 · n=20

Run next

Methods that chain well after this one.

Deepstory methods are process guidance for AI tools. Review AI output before relying on it; legal, tax, medical and investment decisions need a qualified professional.