Python · live now

Pandas

Labelled data in one and two dimensions: importing and exporting, selecting and filtering rows, handling missing values, transforming columns, and grouped aggregation.

No account needed to read a lesson · 30-day money-back guarantee

See the full learning path

9

lessons

79

practice questions

90

prerequisite lessons

See it taught

1 of the 9 lessons here is free to preview - the whole explanation and worked example, with no account and no email.

The editor you get

A still of the editor, not a live one

Python Editor

1 2 3 4
import pandas as pd s = pd.Series([3, 1, 2]) print(s.sort_values().tolist())

Editor Output

1

Output:

[1, 2, 3]

You write and run Python in the browser - nothing to install, no setup. Questions are marked on the values your code produces. The snippet here is an example of the kind of code you write.

The 9 lessons

The 9 lessons in this unit. Expand any one to see what it covers. Each unlocks when its own prerequisites are passed.

01

Pandas Series - 1D labelled data

10 questions

Learn how Pandas Series store one-dimensional labelled data, how to create Series from lists, dictionaries or arrays, and how to access elements by position or by label using .iloc and .loc.

Covers

What is a Series?

Creating Series (from lists, dicts, NumPy arrays)

Basic Series indexing

02

Pandas DataFrames - 2D labelled data

10 questions

Learn how to create Pandas DataFrames from dicts or lists, inspect their content and structure using built-in methods, and access key metadata such as shape, columns and data types.

Covers

Creating a DataFrame (from dicts, lists)

Inspecting DataFrames (head(), tail(), info(), describe())

DataFrame shape, columns, dtypes

03

Importing & exporting data in Pandas

6 questions

Learn how to load tabular data from CSV files into Pandas DataFrames using pd.read_csv(), and how to export DataFrames back to CSV format using .to_csv().

Covers

Reading CSV files (pd.read_csv())

Writing DataFrames to CSV (.to_csv())

04

Indexing and selecting Pandas DataFrames

10 questions

Learn how to select columns from a Pandas DataFrame using label-based access, use .iloc for positional indexing and .loc for label-based indexing of rows and columns.

Covers

Selecting columns

Positional indexing with .iloc

Label-based indexing with .loc

05

Conditional selection & filtering in Pandas

7 questions

Learn how to filter Pandas DataFrames by applying single or multiple conditions using boolean masks and logical operators to select specific rows and columns.

Covers

Filtering rows by a single condition

Combining multiple conditions with &, |, and ~

06

Missing data in Pandas

9 questions

Learn how to detect, count and locate missing values in Pandas DataFrames, then handle them by either dropping incomplete rows or columns or by filling missing entries with appropriate replacement values using built-in methods and parameters.

Covers

Detecting missing values

Dropping missing values

Filling missing values

07

Basic DataFrame transformations in Pandas

9 questions

Learn how to rename columns, set DataFrame indices, change column data types for analytical correctness and efficiency, and create or transform columns using arithmetic and string operations in Pandas.

Covers

Renaming columns and setting the index

Changing column data types

Creating and transforming columns

08

Custom transformations with Pandas .apply()

9 questions

Learn how to use the Pandas .apply() method to execute custom functions on DataFrame columns or rows, including with lambda functions, enabling flexible transformations that go beyond built-in vectorised operations.

Covers

Column-wise application with .apply()

Row-wise application with axis=1

Using .apply() with lambda functions

09

Pandas aggregations and groupby operations

Preview

9 questions

Learn how to quickly summarise pandas DataFrames using built-in aggregation methods, and use .groupby() to compute statistics for single or multiple groups.

Covers

Simple aggregations on DataFrames and Series

Using .groupby() operations with single groups

Multi-column grouping

Preview this lesson - no account needed

Where this unit sits in the curriculum

This unit is part of our Essential Python for Data Science and ML learning path, which contains 117 lessons. Every one of them is drawn below.

The diagnostic test lets you skip any lesson you already know, including the ones in this unit.

Every dot is a lesson and every line a prerequisite. The 9 red dots are the lessons in Pandas; the 90 blue dots feeding into them are the lessons Pandas depends on; the 18 pale dots are the rest of the learning path, which come after Pandas or alongside it.PandasFirst lessons on the left117 lessons

Hover any dot to name its lesson.

9 lessons in this unit

90 prerequisite lessons across the unit, counting every step back to the start

18 other lessons in the learning path - after this unit, or alongside it

Every dot is a lesson, every line a prerequisite. You can only start a lesson once you have mastered all of its prerequisites, so you are always building on solid foundations.

Start Pandas

One subscription covers every learning path, and you can test out of anything you already know.

One subscription covers every learning path · 30-day money-back guarantee

More in Libraries for data science and machine learning: NumPy