सामग्री पर जाएँ

लेसन 1 · Getting Started

What Is Data Cleaning?

Learn what data cleaning is, why messy data leads to wrong answers, what you need before you start, and how this tutorial takes you from profiling to projects.

Data cleaning is the work of finding and fixing problems in a dataset so that it can answer a question honestly. Names are spelled three ways, a price column holds the text "N/A", the same customer appears twice, a date says the 31st of February. None of these is dramatic on its own. Together they can change a total, hide a trend or send an email to the wrong person.

This tutorial is for anyone who works with tables: analysts, students, developers, researchers and people who live in spreadsheets. You will learn a repeatable way to inspect data, decide what is wrong, fix it and show what you changed.

What you need

You should be able to read a table of rows and columns. Basic Python helps for most lessons, and basic SQL helps for the SQL chapter. You do not need statistics beyond averages. The few extra ideas are explained when they appear.

What this tutorial can and cannot run

  • Python examples run in your browser. Many use only the standard library. Some use pandas, which loads the first time you press Run and can take a little while.
  • SQL examples run in your browser on SQLite. Each block creates its own tables.
  • Spreadsheet formulas and Power Query steps are shown as read-only text. Try them in your own spreadsheet program.
  • All data here is made up. No real people appear.

This tutorial is independent. It is not affiliated with or endorsed by any software vendor.

Why it matters

Look at how a small problem changes an answer. The list below holds four order amounts as text, as they might arrive from a file export.

Python The same data, two different totals

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The naive version lost the largest order because of a comma, and it said nothing. The careful version also tells you that one amount is unknown. That second line is as important as the total, because it tells the reader how complete the answer is.

Clean for a purpose

There is no such thing as perfectly clean data. "Clean" means fit for a particular use. A wrong postal code matters for shipping and may not matter for a chart of sales by month. Before you change anything, write down the question you want to answer. It tells you which problems deserve your time.

Cleaning can distort data as easily as it fixes it. If you delete every row that looks strange, your results describe only the tidy part of reality.

Common kinds of problems

Problem Example
Missing values An empty age, or -999 used as "unknown"
Duplicates One order imported twice
Wrong types Numbers stored as text
Inconsistent text USA, U.S.A., United States
Bad dates 03/04/2026 with no clear order
Impossible values A negative height, an age of 240
Broken links An order pointing to a customer who does not exist

You will rarely meet only one of these at a time. A real export often has several, and they interact. Untidy text, for example, can hide duplicates until you standardize it.

Course map

Look first

Read the file Encodings and structure
Profile it Counts, ranges, patterns
1 / 4

Read the chapters in order the first time. Later, jump to the lesson that matches the problem in front of you.

A word about privacy

Real datasets often contain names, addresses, health details or payment data. Follow your organization's rules and the laws that apply to you. Work only with the columns you need, keep files in approved places, and do not paste private rows into online tools or AI chat services unless you are allowed to.

A worked example in words

Suppose a manager asks, "How much did we sell in March?" You receive an export with one row per order line. Before you add anything, you check a few things. Do any order lines appear twice? Are all amounts numbers? Do some dates belong to another month once you read them in the right order? Are refunds stored as negative amounts, or in a separate file?

Each answer can move the total. None of them can be found by looking only at the final number, which will look perfectly reasonable whether it is right or wrong. That is why cleaning is less about making a table look neat and more about knowing what is in it.

When you report the result, you can then say something far more useful than a bare total: how many lines it includes, how many you excluded, why you excluded them and which assumptions you made. A reader who disagrees with an assumption can say so.

Skills you will practice

By the end of the tutorial you should be able to:

  • load a file without silently damaging it;
  • describe a new dataset with a short, factual profile;
  • choose a defensible way to handle gaps, repeats and strange values;
  • write rules in Python, SQL or a spreadsheet and test them;
  • explain to other people what changed and what remains uncertain.

You do not need to memorize functions. The valuable habit is asking, at every step, "What could this rule get wrong, and how would I find out?"

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. What does it mean for data to be clean?

    Cleanliness depends on use. A flaw that breaks one analysis may be harmless in another.
  2. 2. Why was the naive total in the example wrong?

    The value with a thousands separator failed to convert and was dropped without any warning.
  3. 3. What should you do before changing a dataset?

    The question decides which problems matter and which fixes are safe.

Summary

  • Data cleaning finds and fixes problems so data can answer a question honestly.
  • Silent errors are the dangerous ones, so count what you skip.
  • "Clean" means fit for a purpose.
  • Python and SQL examples run here; spreadsheet steps are read-only.
  • Protect personal and company data while you clean.

Next: A Safe Data Cleaning Workflow

आपकी प्रगति इसी ब्राउज़र में सेव होती है। खाते की ज़रूरत नहीं है।