Free course · 11 lessons · Beginner

Data Analysis with pandas

Analyse data with pandas 3: DataFrames and Series, loading messy CSV files with the right types, selecting and filtering, cleaning missing values, duplicates and text, transforming columns without loops, grouping and aggregation, merging tables safely, pivot tables and melt, time series with resampling and rolling windows, and fast, correct pandas 3 code with copy-on-write. Every example runs in your browser.

Start the course

1. pandas Fundamentals

DataFrames and Series, loading data, selecting and filtering rows, cleaning messy data, and adding and transforming columns.

  1. DataFrames and Series — Create and inspect DataFrames and Series: shape, dtypes, head, info and describe, and how columns are Series that share an index.
  2. Loading Data: read_csv Done Right — Read CSV files with the right types, dates, missing-value markers and column selection, and write results back to CSV or JSON.
  3. Selecting and Filtering Rows and Columns — Select data by label with loc, by position with iloc, filter rows with boolean conditions and isin, and use query for readable filters.
  4. Cleaning Messy Data — Handle missing values, duplicates, inconsistent text and wrong types: the cleaning steps almost every real dataset needs.
  5. Adding and Transforming Columns — Create new columns with vectorised arithmetic, conditions with np.where and cut, mappings, and method chains with assign, avoiding slow row loops.

2. Analysis with pandas

Group and aggregate, merge tables, reshape with pivot tables and melt, analyse time series, and write fast, correct pandas 3 code.

  1. Grouping and Aggregation — Summarise data by groups with groupby and named aggregations, add group statistics to rows with transform, and rank within groups.
  2. Merging and Joining Tables — Combine tables with merge like SQL joins, check relationships with validate, find unmatched rows with indicator, and stack tables with concat.
  3. Reshaping: Pivot Tables, Melt and Crosstab — Turn long data into wide summary tables with pivot_table, back into long format with melt, and count combinations with crosstab.
  4. Time Series: Dates, Resampling and Rolling Windows — Work with datetime columns, resample events into daily or weekly totals, fill missing days, and compute rolling averages and changes.
  5. Fast and Correct pandas 3 Code — Write pandas code that is correct under copy-on-write, uses the new string dtype, saves memory with categories, and avoids slow patterns.

3. Capstone

Analyse a real business question end to end.

  1. Capstone: Analyse Subscription Churn — Plan and carry out an end-to-end pandas analysis of subscription churn: loading, cleaning, joining, metrics, cohorts and presenting results.

Was this page helpful?