Summarising and combining

Describing columns with centre and spread, grouping and aggregating, and joining tables on keys.

About 6 hours of study

Learning objectives

Lessons

  1. 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. 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. 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

Module quiz

1. Which pair summarises a skewed column best?
2. Grouping sales by region and summing gives…
3. A left join keeps…
4. After a join, the row count grew unexpectedly. The likely cause is…
5. Why compare group averages rather than group totals?
6. Q1 = 10 and Q3 = 20. Which value is an outlier by the 1.5 × IQR rule?

‹ Cleaning and shaping dataExploring relationships and time ›