AI Hints
Home›Data Science Tutorial›What Data Science Is
Data Science · Lesson 1 of 101

Your First Day at Harbor Coffee

Two years of data, zero answers.

⏱ 2 min read▶ Video at 2:26🎓 Free
Watch this lesson in the Data Science courseWatch on YouTube ↗Full Data Science course

Welcome to Harbor Coffee. Twelve cafes, in six countries, and two years of sales data sitting untouched. The founder walks up to your desk and says, I've got a feeling that some of our cafes are losing money, but nobody can tell me which ones. Can you find out? That's data science. Turning a pile of numbers into an answer that changes what people do.

Your First Day at Harbor Coffee
From the video: Your First Day at Harbor Coffee
  • Harbor Coffee: twelve cafes
  • Two years of untouched data
  • Turn numbers into decisions

Answering in ten lines

Let's get to work. We load seventy thousand rows of sales with a single line. We add up revenue and profit. Then we group by region. Run it. In a few seconds, we know the total revenue and profit, and how each region compares. That's something nobody at Harbor Coffee could answer an hour ago. Notice that we didn't use any fancy model. A huge part of data science is asking clear questions, and counting carefully.

first_look.pypython
import pandas as pd

sales = pd.read_csv("sales.csv", parse_dates=["date"])

print("Rows:", len(sales))
print("Revenue:", f"${sales['revenue'].sum():,.0f}")
print("Profit: ", f"${sales['profit'].sum():,.0f}")
print()
print(sales.groupby("region")["profit"].sum().sort_values(ascending=False).round(0).to_string())
Output
Rows: 70176
Revenue: $6,453,124
Profit:  $4,191,896

region
Europe      1475310.0
Africa      1058432.0
Asia         916051.0
Americas     742103.0

What a data scientist does

A data scientist does four things. Ask a clear question. Get and clean the data. Find the answer, using analysis, statistics, or models. And then persuade people to act on it. That last step is the one most courses skip, and it's the one that matters the most. An insight that doesn't change a decision is worth nothing.

Aska clear question
Prepareget and clean data
Analysestatistics and models
Persuadechange a decision

Summary

You've already answered your first real business question. And you know that the goal isn't a chart. It's a decision. But how is data science different from data analysis, or machine learning? Let's clear that up.

Key takeaways
  • Load, group, count
  • Clear questions beat fancy models
  • The goal is a better decision
Next up: The Data Science Family — analyst, scientist, engineer