Module 1: Getting started · Lesson 1.1 · about 10 min
Why pandas, and how to use this course
What pandas is, why analysts use it alongside Excel, SQL and Power BI, and how the code boxes in this course work: edit, Run, Check, Hint and Show answer, all in your browser.
Module 1 · about 10 minutes · no Python needed. You’ll know what pandas is for, and how to use the code boxes in this course.
In everyday terms: a spreadsheet is cooking by hand every time; pandas is writing the recipe down. The first meal takes a little longer, and every meal after that is one click, exactly the same, and anyone can check the recipe.
1. What pandas is
pandas is the Python library analysts use for tables: load a file, clean it, filter it, group and summarise it, join it with other tables, and reshape it for a report or a chart. It’s the “Excel and SQL inside Python” that most data analyst job ads ask for.
Why analysts reach for it:
- Repeatable: a script cleans next month’s export exactly like this month’s.
- Bigger data: millions of rows, where spreadsheets slow down or stop.
- Everything in one place: cleaning, analysis, statistics and charts, with every step written down.
- Works with your other tools: read from Excel and SQL databases, write files for Power BI or Tableau.
2. Try it: your first code
Python runs right here in the page. Press Run (or Ctrl+Enter, ⌘+Enter on a Mac). The first run downloads Python once, about 20 MB; after that it’s instant and works offline.
You’ve just read a CSV file into a DataFrame: a table with named columns. Change the last line to stores.shape and run it again: it tells you the number of rows and columns.
3. How the boxes work
- Example boxes (marked Python): edit anything and run it. Reset puts the original code back.
- Exercise boxes (marked Your turn): write code, then press Check. Hint gives a nudge; Show answer fills in a solution and runs it.
- Each box runs on its own, with
pandasalready available aspd. - The last line of a box is shown if it’s a value (a table, a number); use
print()to show anything else. - Errors show the line and the message. Read the last part first:
KeyError: 'Store'means there is no column calledStore.
- DataFrame
- A table: named columns, rows with labels.
- Series
- One column of a DataFrame.
- Method
- An action on a table, written table.action(): orders.head(), orders.groupby(...).
- Physical meaning
- Every pandas line is a step you could do by hand in a spreadsheet: filter, sort, total, join. The difference is that the steps are written down, so next month's file goes through exactly the same steps in a second.
“pandas is for programmers, not analysts.” Most analyst pandas is a dozen commands: read, filter, group, join, pivot, plot. If you can write a spreadsheet formula, you can write these. This course teaches exactly that dozen first.
Watch it happen, one step at a time:
orders = pd.read_csv('orders.csv'): 9,717 order lines in memory.orders.groupby('store_id')['qty'].sum(): one total per store..sort_values(ascending=False): biggest first.How it works
Principle: pandas stores each column as a typed array (numbers, text, dates), so an operation on a column runs on all its values at once, in fast compiled code, instead of one cell at a time.
In this course: Python and pandas are Pyodide, a build of Python for web browsers, served from fibub itself. Your code runs on your device; nothing is uploaded. The datasets (a made-up shop’s stores, products, customers and orders) are small CSV files the page reads when a box needs them.
4. The data we’ll use
A made-up retail chain with six stores and a website:
| File | One row per | Rows |
|---|---|---|
stores.csv |
store | 7 |
products.csv |
product | 32 |
customers.csv |
customer | 1,200 |
orders.csv |
order line (one product in one order) | 9,717 |
orders_messy.csv |
a messy export, for cleaning practice | 412 |
The same tables come back throughout, so by the capstone you’ll know them well.
5. Practice
Answer in words, then check:
- Name two things pandas does better than a spreadsheet.
- What does the last line of a code box do?
Answers
- Repeating the same steps on new files; handling millions of rows; keeping every step written down; joining many tables.
- If it’s a value (a DataFrame, a number), the box shows it, as if you’d printed it.
Try it on your own data: fibub’s CSV profiler gives an instant first look at any CSV in your browser, with no code.
New words: pandas, library, DataFrame, Pyodide.
- pandas works on tables (DataFrames) made of columns (Series).
- Code is a written recipe: repeatable, checkable and shareable.
- A handful of commands covers most analyst work.
- Every code box here runs real Python in your browser; edit and run freely.
Check yourself
Sources
- McKinney, W. (2022), Python for Data Analysis, 3rd edition, O'Reilly (open access) https://wesmckinney.com/book/
- pandas documentation, User Guide: 10 minutes to pandas https://pandas.pydata.org/docs/user_guide/10min.html
Your ticks stay in this browser. Save them as a file on the course home.
Updated 2026-11-22. All datasets are made up. Python runs in your browser (the first run downloads it once, about 20 MB); nothing you type is sent anywhere.