Course Overview
Your community data desk
A community market records its stalls, orders, and event days. One sheet has the sales; another has the stall names. Some records are incomplete. You'll use pandas to bring these records together and answer questions such as which stalls sold the most and how sales changed from day to day.
The tables stay small enough to check by eye. Before trusting a calculation, you'll be able to point to the rows it used.
Before you begin
You should be comfortable with Python variables, lists, dictionaries, functions, and import. You don't need spreadsheet or statistics experience. We'll explain the table vocabulary and calculations as they appear.
The course editor is ready to run the supplied examples. You don't need to download market data or install a package to start. The import import pandas as pd gives pandas its usual short name, pd.
How to practise
Most topics start with a working example in main.py. Make the requested small change and use Run to inspect what happened. The following exercise uses different data so you can try the same idea yourself.
Submit checks the numbered tasks. You can submit partly finished work to find out which steps are working; you don't have to finish the whole exercise first. A short quiz closes each section.
When a result surprises you, compare the input and output tables. Check the row labels, column names, and values separately. Those details often explain why a selection or calculation behaved differently from what you expected.
What you'll build
- Start with a Series, a line of values with labels, then a DataFrame, a table with named columns.
- Choose rows and columns, write filters, and put results in a useful order.
- Handle missing cells and inconsistent text without losing track of the original records.
- Match related tables and summarise groups of rows.
- Read and write small data samples, then work with dates.
The final section brings these skills together in a market report. You'll build it in stages, checking the intermediate tables before producing the summary.
Begin with the labeled-data introduction. You'll see why a row's label can matter just as much as its value.
Syllabus
- Build a market table
- Exercise: Assemble two tables
- Inspect labels and dtypes
- Exercise: Read the table card
- Preview and summarize rows
- Exercise: Check the new delivery
- Select a column
- Exercise: Pack a report view
- Find a row and column
- Exercise: Look up table cells
- Add a calculated column
- Exercise: Calculate market revenue
- ✦Module Quiz
- Choose columns for a stall card
- Exercise: make a vendor contact sheet
- Find rows by label and position
- Exercise: inspect two delivery windows
- Filter stalls with a comparison mask
- Exercise: shortlist ready orders
- Combine two selection rules
- Exercise: build two volunteer queues
- Match a list of categories
- Exercise: list invited workshop types
- Order a stall leaderboard
- Exercise: rank pickup points
- ✦Module Quiz
- Spot missing records before filing
- Exercise: audit delivery addresses
- Fill an absent attendance count
- Exercise: complete inspection ratings
- Recognize repeated entries
- Exercise: reconcile order revisions
- Turn text counts into numbers
- Exercise: repair case quantities
- Standardize names and column labels
- Exercise: standardize workshop registrations
- Update selected rows safely
- Project: prepare a market log
- ✦Module Quiz
- Count values and rows
- Exercise: Summarize zone receipts
- Profile values and labels
- Exercise: Profile stall visits
- Group on two labels
- Exercise: Group shift totals
- Name grouped results
- Exercise: Name category measures
- Return a baseline per row
- Exercise: Compare visits to a group
- Pivot a daily grid
- Mini project: Publish the market summary
- ✦Module Quiz
- Read a market CSV
- Exercise: load inventory CSV
- Parse dates while reading
- Exercise: convert sign-up dates
- Find the day with dt
- Exercise: count visitors by weekday
- Read JSON records
- Exercise: load a JSON roster
- Export CSV without an index
- Exercise: round-trip a sales table
- Sketch data with text bars
- Exercise: chart item totals
- ✦Module Quiz