explaingit

guipsamora/pandas_exercises

12,728Jupyter NotebookAudience · dataComplexity · 1/5Setup · easy

TLDR

Practice exercises for learning pandas, the Python data library, using real datasets like Chipotle orders and Titanic records. Each topic has three files: instructions only, expected output only, and full solution.

Mindmap

mindmap
  root((pandas_exercises))
    Topics
      Filtering and sorting
      Groupby aggregation
      Merging datasets
      Time series
      Visualization
    Datasets
      Chipotle orders
      Titanic passengers
      Apple stock prices
      US baby names
    File Format
      Exercise only
      Expected output
      Full solution
    Audience
      Python beginners
      Data learners
      Self-studiers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Practice filtering, grouping, and merging tabular data with pandas using familiar real-world datasets.

USE CASE 2

Test your pandas skills on time-series data with Apple stock price exercises.

USE CASE 3

Learn to create charts and compute statistics from datasets like US baby names or Pokemon records.

Tech stack

PythonpandasJupyter Notebook

Getting it running

Difficulty · easy Time to first run · 5min
No explicit license is stated in the description, check the repository before using the material commercially.

In plain English

This repository is a collection of practice exercises for pandas, a Python library widely used for working with tabular data. The creator made it because they found plenty of tutorials explaining pandas concepts but almost no places to actually practice using them. The exercises fill that gap. Each topic in the collection comes in three files: one with the exercise instructions and no answers, one with the expected output but no code, and one with full code and explanations. The suggested approach is to attempt each exercise after reading about a topic, check only the expected output if stuck, and look at the code solution only as a last resort. The exercises are organized by skill area. Topics include loading data and exploring its structure, filtering rows and sorting, grouping data to compute summaries across categories, applying custom functions to data, merging multiple datasets, computing statistics, creating charts, working with time-series data, and deleting rows or columns. Each topic uses a different real-world or familiar dataset, such as Chipotle restaurant orders, Titanic passenger records, Apple stock prices, US baby name statistics, and Pokemon data. The exercises are Jupyter notebooks, which run interactively in a browser. You write code in cells, run each cell, and immediately see whether your output matches the expected result. No special setup is described beyond having pandas and Jupyter available. Video walkthroughs of the exercises are also linked at the bottom of the README for learners who prefer to watch someone work through the problems before or after attempting them independently. Contributions of new exercises are welcome through the standard GitHub pull request process.

Copy-paste prompts

Prompt 1
I'm learning pandas and want to practice groupby. Give me a step-by-step solution for the Chipotle orders groupby exercise from pandas_exercises and explain what each line does.
Prompt 2
Using the Titanic dataset from pandas_exercises, show me how to filter passengers by survival status and compute average fare per ticket class.
Prompt 3
I'm stuck on the time-series section of pandas_exercises. Explain how to resample Apple stock prices by month and plot the monthly closing average.
Prompt 4
How do I merge two DataFrames in pandas? Walk me through the approach used in the merge section of guipsamora/pandas_exercises with an example.
Prompt 5
I've finished all the pandas_exercises topics. What real project could I build next to apply groupby, merging, and time-series skills together?
Open on GitHub → Explain another repo

← guipsamora on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.