Summarising and combining
Describing columns with centre and spread, grouping and aggregating, and joining tables on keys.
About 6 hours of study
Learning objectives
- Summarise a column with centre, spread and outliers
- Group rows and aggregate each group
- Join two tables and check the result
Lessons
- 1
Descriptive statistics Intermediate
Summarising a numeric column: the mean, median and mode for its centre; the range, variance, standard deviation, quartiles and IQR for its spread; and finding outliers with the 1.5 × IQR rule.
- 2
Grouping and aggregation Intermediate
Split, apply, combine: grouping rows by one or more keys with dictionaries, aggregating each group with counts, sums, means, minimums and maximums, sorting the results, and building cross tabulations.
- 3
Joining tables Intermediate
Combining tables through a shared key: building a dictionary index, inner joins that keep matches, left joins that keep every row of one table, many-to-one relationships, and finding rows that match nothing.
Module practice
- Data science: The five-number summaryEasy
- Data science: Find outliers with the IQR ruleMedium
- Data science: Which group is more consistent?Hard
- Data science: Count each categoryEasy
- Data science: Summarise salaries by departmentMedium
- Data science: Build a cross tabulationHard
- Data science: Look up product namesEasy
- Data science: Keep everyone with a left joinMedium
- Data science: Join three tablesHard
Module quiz
‹ Cleaning and shaping dataExploring relationships and time ›