E ExamMaster

Data Science · Data Science Core

What data science is

In Data Science because the job is to turn a question into a table and decide whether the rows support a claim — before anyone fits a model.

Start with something you can picture: Rao's Corner Shop, a small counter that kept a notebook of this week's customers. Eight people walked in. For each person the notebook can record a few plain facts — how many times they visited, how many rupees they spent, whether they pay a monthly plan or drop in, and whether they came back later in the week. Data science starts with a question those rows can answer, not with a model. You will clean that sheet, summarise it, and chart it. Machine Learning's 200-flat rent notebook is the other door — a table already clean and ready to fit. This course stops at the story in the rows.

  • Data Science
  • Medium level
  • 5 concepts

1A question becomes a table

Start with Rao's week, not with a library. The owner asks a question you can say in ordinary words: among this week's customers, who came back, and did the people on a monthly plan behave differently from the people who just dropped in? That sentence already names who each row is — one customer in this week — and what you will count: whether they came back, and which plan they were on.

A question like that forces columns, the same way Machine Learning's rent notebook forces size, distance and age. Here the columns are name (who the row is), visits (how many times they came), spent (rupees they paid), plan (monthly or drop-in), and came_back (yes or no). If you cannot name those columns, you do not yet have a question — you have a vibe. A sheet that holds only name and spent cannot answer 'who came back' or 'did monthly members differ', because those facts were never written down.

Engineering Python already taught you how to build a DataFrame — a table the computer can hold. This course asks a prior question: is that frame the right answer-shaped table for the owner's sentence? Data science is the pipeline from a question you can answer from rows, through a table that holds those rows, to a claim you can point back at the table.

Figure. The owner's question plants five column names the way the rent notebook plants size, distance and age. name is who the row is; visits is how many times they came; spent is rupees paid; plan is monthly or drop-in; came_back is yes or no. A sheet missing plan or came_back cannot answer the question.

The pipeline

  1. QuestionName who the rows are and what you will count. For Rao: this week's customers, and whether they came back, split by plan.
  2. TableOne column per fact the question named: name, visits, spent, plan, came_back.
  3. ClaimA sentence you can point back at those rows — a count, not a vibe.

Coding lab. Name the five columns runs in the app, with checks on your output.

You want to know whether monthly members at Rao's shop came back more often than drop-ins. What is missing if the sheet has only name and spent?
  1. plan and came_back — the grouping and the outcome the question named
  2. A sklearn estimator
  3. A 200-row rent table

The question named a group (plan) and an outcome (came_back). Spent alone cannot answer it.

2Each row is one case

Stay with the shop sheet, and read one line the way the rent notebook reads one flat. Anu's row, left to right, is 4, 320, monthly, yes: she visited four times, spent Rs 320, pays a monthly plan, and came back. That whole line is one person in this week. Nothing about Anu that we did not write down exists on the sheet — not her favourite snack, not her mood.

Bala is a different line: 1 visit, Rs 80, drop-in, did not come back. Mixing Anu and Bala into one row would invent a person who does not exist — a monthly member who spent Rs 80, or a drop-in who visited four times. Deepak's line is visits 0, spent 0, monthly, no. Those zeroes stay on Deepak's row; they are a quiet monthly member, not a broken cell and not a second person.

If you later sort by spend or keep only monthly members, you move whole rows. Visits, spend, plan, and came_back for the same person stay together — that is what makes a later claim honest.

Figure. One row is one customer. Read Anu left to right: 4 visits, Rs 320, monthly plan, came back. Those four facts belong to Anu together. They are not four free numbers you can mix with Bala's line.

Rao's Corner Shop — one week
namevisitsspentplancame_back
Anu4320monthlyyes
Bala180drop-inno
Chitra6510monthlyyes
Deepak00monthlyno
Esha3240drop-inyes
Farah2150monthlyyes
Gopal5400monthlyyes
Hari160drop-inno

Coding lab. Read Anu's whole row runs in the app, with checks on your output.

Deepak's row is visits 0, spent 0, plan monthly, came_back no. What is that row?
  1. A real case: a monthly member who did not visit this week and did not come back
  2. A broken row you must delete because zeroes are always errors
  3. Two people accidentally merged

Zero can be a fact. Deepak is a quiet monthly member, not a typing accident.

3A claim must point at rows

A claim is a sentence the table can support or refute. Walk the came_back column on Rao's eight rows: Anu yes, Bala no, Chitra yes, Deepak no, Esha yes, Farah yes, Gopal yes, Hari no. That is five yes and three no. So 'five of eight customers came back this week' is a count, not a vibe — you can put your finger on the five names.

The same walk inside one plan: the monthly rows are Anu, Chitra, Deepak, Farah, Gopal. Four of those five say yes (Deepak is the no). 'Customers love us' cannot point at any column. There is no love column and no survey. A sentence the sheet cannot support is marketing, not a claim.

Figure. Five of the eight customers have yes in came_back; three have no. The bars are that count, not a model score and not a feeling about the brand.

Claims this week can and cannot carry
sentencesupported?
5 of 8 customers came backyes — count the came_back column
4 of 5 monthly members came backyes — filter plan, then count
Customers love the shopno — no love column, no survey

Comebacks from the eight names

came_back reads yes, no, yes, no, yes, yes, yes, no. How many came back, and how many of the five monthly members came back?

  • yes names: Anu, Chitra, Esha, Farah, Gopal5 of 8
  • monthly rows: Anu, Chitra, Deepak, Farah, Gopal5 people
  • monthly yes: Anu, Chitra, Farah, Gopal4 of 5

Pro tip. Deepak is monthly and no. Leaving him out would invent a richer group.

Coding lab. Count the yes rows runs in the app, with checks on your output.

Which sentence is a claim Rao's eight-row sheet can support?
  1. Five of eight customers came back this week
  2. The shop will double revenue next year
  3. Drop-ins are happier than members

Only the first sentence is a count of a column that exists.

4Same sheet, different stop

The shop sheet has already answered the owner: five of eight customers came back this week, and four of the five monthly members came back. That is a story in the rows. If that sentence is enough to decide — keep the monthly plan, change the drop-in offer, restock for the people who return — you do not owe anyone a model.

Machine Learning can take this same churn-shaped sheet, treat came_back as a label (the known answer on each line), and fit a predictor that guesses came_back for a new customer. That work lives in the Machine Learning course, including the 200-flat rent notebook where size, distance and age already sit in clean columns ready to fit. Data Science stops earlier: clean the rows, summarise them, chart them, and say what the table supports. We do not teach linear models, trees, or train/test as the spine.

No diagram — the idea is carried by the prose, table, code block or coding lab.

Where each course stops
coursethis shop sheet
Data ScienceWho came back? Do monthly members differ? Chart it.
Machine LearningGiven a ready table, predict came_back and score the fit.
You have Rao's eight-row sheet and the owner asks 'did monthly members come back more often?' What does Data Science do?
  1. Count came_back inside each plan and say what the rows show
  2. Fit logistic regression and report test accuracy
  3. Train a neural net on the names

The question is a story in the rows. Fitting is Machine Learning.

5Lab: build the shop table

Time to hold the eight-row sheet in pandas yourself. This lab builds Rao's week as a DataFrame — a table the computer can hold — and prints how many customers came back. No model is fitted anywhere, because the lesson is the count, not a score.

Meet the column names before you run the cell, because the code uses them as written. name is who the row is. visits is how many times that person came this week. spent is rupees they paid. plan is monthly or drop-in. came_back is the text yes or no — not a 1 or 0, not a label for a fit. df is the usual short name for that table.

The last line, (df['came_back'] == 'yes').sum(), does two things in order. First it asks, for each row, whether that row's came_back cell equals the word yes, which gives eight True/False answers. Then .sum() counts the Trues. You should see 5 — Anu, Chitra, Esha, Farah, Gopal. If you see 8, you counted rows instead of yeses. If you see 0, the words in the column do not match the word you compared.

No diagram — the count is printed by the coding lab, not a static figure.

Lab checklist
StepWhy
Build the eight-row frameOne row per customer, five named columns
Compare came_back to yesThe question named that column
Print the countThe check looks for 5 — not a fit score

Coding lab. Build Rao's shop sheet runs in the app, with checks on your output.

Why does this lab print a count instead of calling fit?
  1. Data Science answers the question from the rows; fitting is Machine Learning
  2. pandas cannot store yes/no
  3. Eight rows are too many for a table

The lab stops at the story in the rows.

Notes

  • In Data Science because the job is to turn a question into a table and decide whether the rows support a claim — before anyone fits a model.
  • A data-science question names who the rows are and what you will count. For Rao's shop the question is: among this week's customers, who came back, and did monthly members behave differently from drop-ins?
  • On Rao's sheet, each row is one customer in this week. Read Anu left to right — 4 visits, Rs 320, monthly, came back — and you have one real person, not a blend.

Exam traps & shortcuts

  • Name the question before you open the sheet — a table without a question is just a dump.
  • A number is a claim only when you can point at the rows that produced it.

Recap

Question, then table, then a claim you can point at. Same churn-shaped sheet as ML; Data Science stops before fit.

A question becomes a table
The shop question names who the rows are (this week's customers) and what you will count (came back, split by plan). That forces five columns: name, visits, spent, plan, came_back.
Each row is one case
Anu's row is one person: 4 visits, Rs 320, monthly, came back. Mixing Anu and Bala into one row would invent a person who does not exist.
A claim must point at rows
Five of eight customers came back; four of five monthly members came back. Those are counts of columns that exist, not a vibe.
Same sheet, different stop
Once the rows have answered the owner, Data Science can stop. Fitting a predictor on came_back is Machine Learning's job, including the 200-flat rent notebook.

Practise What data science is

Reading is free and needs no account. Practice, mocks and progress live in the app.

  • A 3-question practice set that ends the chapter
  • 5 quick checks with worked explanations
  • Timed mocks scored with the real marking scheme
  • Readiness tracked per topic, kept on your device
Continue with Google — freeNo card, no trial. Works offline once installed.