Week 4: Relational Tables — keys, joining and tidying
Learning Objectives
By the end of this week, students will be able to:
- Explain the concept of a primary key and a foreign key
- Perform inner, left, right, and outer joins with
pd.merge - Identify and apply tidy data principles (one observation per row, one variable per column)
- Reshape data between wide and long formats using
meltandpivot
Perspectival Reading
Reading: TBD
Reflection Questions
- The relational model assumes data can be cleanly separated into tables with keys. What kinds of knowledge resist this structure?
- When tables from different sources are joined, whose data definitions take precedence?
- Tidy data is a design choice — what does it mean to say data is “messy”?
Slides
Notebook Demo
Open in Google Colab (link TBD)
Lab Assignment
Week 4 Lab — GitHub Classroom (link TBD)