Module 4: Data Manipulation

This module covers the core data manipulation operations youโ€™ll use in nearly every analysis: creating and transforming columns, aggregating data across groups, and combining multiple tables with joins. By the end of Week 4, youโ€™ll be able to go from a raw table to a meaningful summary in a few lines of pandas code.

Learning Objectives

By the end of this module, you will:

  • Create and modify columns using assignment, arithmetic, and string operations
  • Summarize data using .groupby() and .agg() with multiple aggregation functions
  • Join two DataFrames on a key column using pd.merge()
  • Choose the correct join type (inner, left, right, outer) for a given analytical need

Module Resources

Lecture

Resource Link
๐Ÿ“Š Week 4 Slides View slides
๐Ÿ’ป Week 4 Data Detective Open in Colab

Chapters & Notebooks

Each chapter has a companion Colab notebook with all the code from the chapter โ€” ready to run, no installation required.

Chapter Topic Colab Notebook
10 Manipulating Data Open in Colab
11 Aggregating Data Open in Colab
12 Joining Data Open in Colab

Lab

Resource Link
๐Ÿงช Lab 4 Open lab

Reference

Resource Link
๐Ÿ“‹ Module 4 Cheat Sheet View cheat sheet