Pandas

A free pandas course for beginners: load, select, filter, clean, group, merge and reshape real data in Python, with exercises and projects.

7 modules · 8 lessons so far

Module 1 · Beginner

Getting started with pandas

What pandas is, its two building blocks, and how to load and save data files.

  1. Pandas DataFrame tutorial for beginners
  2. Pandas Series explained, with examples
  3. Read and write CSV, Excel and JSON in pandas

Module 2 · Beginner

Selecting and filtering data

Pick out exactly the rows and columns you need, and put them in order.

  1. How to select columns in pandas
  2. loc vs iloc in pandas, with examples
  3. Filter rows in pandas by conditions
  4. Filter data with pandas query(), with examples
  5. Sort and rank data in pandas

Module 3 · Beginner

Cleaning data

Fix the missing values, duplicates and wrong types that real data always has.

  1. Handle missing values in pandas: isna, dropna and fillna
  2. Remove duplicates in pandas
  3. Change column types with astype and to_numeric
  4. Rename and drop columns
  5. Clean text columns with the .str accessor
  6. Work with dates using to_datetime and .dt

Module 4 · Intermediate

Transforming data

Create new columns and reshape values with apply, map and binning.

  1. Add new columns in pandas
  2. apply, map and vectorised operations
  3. Bin numbers into groups with cut and qcut
  4. Categorical data in pandas

Module 5 · Intermediate

Grouping, merging and reshaping

Summarise data by group, combine tables, and switch between long and wide formats.

  1. Pandas groupby explained, with examples
  2. Pivot tables and crosstabs in pandas
  3. Merge and join DataFrames
  4. Concatenate DataFrames
  5. Reshape data with melt and pivot

Module 6 · Advanced

Time series and performance

Work with dates over time, and keep pandas fast on big files.

  1. Time series in pandas: resample and rolling
  2. Make pandas faster and use less memory
  3. Read large CSV files in chunks

Module 7 · Intermediate

Pandas projects and interview prep

Practise on real datasets, and get ready for pandas interview questions.

  1. Project: analyse IPL match data
  2. Project: clean a messy sales spreadsheet
  3. 50 pandas interview questions with answers
  4. Pandas quick reference

Want to learn this with others?

Join our free Data analytics training, run by the theprogrammers community.