Programmer's Picnic · Python / Pandas · Course index

Pandas: From 0 to Infinity

We begin with a table you create directly in Python. Learn to search it, change it and clean messy records step by step before moving to advanced analysis.

0 to infinity · Learn by making real DataFrames · No file required

What is a DataFrame?

A DataFrame is a two-dimensional table: rows represent records and columns represent fields. Think of a class register with a student's name, city and marks. Each column has a label, and every row has an index.

You do not need CSV, Excel or a database to start. Create a DataFrame from Python values first.

RowNameCityMarksFeePaid
0AshaVaranasi88True
1RaviRanchi42False
2MeeraVaranasi76True
3KabirPatna91False
Python · pandas
import pandas as pd

students = pd.DataFrame({
    "Name": ["Asha", "Ravi", "Meera", "Kabir"],
    "City": ["Varanasi", "Ranchi", "Varanasi", "Patna"],
    "Marks": [88, 42, 76, 91],
    "FeePaid": [True, False, True, False]
})

print(students)

Before you begin: Install Pandas with python -m pip install pandas, then run the example in a Python environment. Check the installed version with print(pd.__version__).

Start here — eight hands-on lessons

Lesson 0Create a DataFrame

Build tables directly using dictionaries and lists. Understand rows, columns and indexes.

New learners · 15–25 minutes
Lesson 1Search and select

Find students by name, marks or city. Master .loc, .iloc and filters.

Data lookup · 20–30 minutes
Lesson 2Change values safely

Correct marks, update several rows, add columns and grow your table.

Data editing · 20–30 minutes
Lesson 3Clean messy data

Detect missing values, remove exact duplicates, fix text and numeric types and validate scores with an audit.

Data cleaning · 35–45 minutes
Lesson 4Sort, group and summarise

Create leaderboards, city averages and multi-column reports with groupby(), agg() and transform().

Data analysis · 40–50 minutes
Lesson 5Read and write CSV files

Import real-world CSV data with read_csv(), control types and dates, export safely with to_csv(), and verify the result.

Data I/O · 45–60 minutes
Lesson 6Merge, join and reshape

Combine related tables safely with merge(), join() and concat(), then reshape data using melt(), pivot() and pivot_table().

Data relationships · 45–60 minutes
Lesson 7Dates, time series and reporting

Parse dates, resample timelines, calculate rolling metrics, build charts and export useful reports.

Time analysis · 50–70 minutes

The 0 → ∞ learning path

The first eight lessons are available now. Continue in this order as the course expands; later topics are a roadmap, not links to unfinished pages.

  1. Level 0: Create DataFrames without files — Start
  2. Level 1: Search, select and filter — Learn
  3. Level 2: Change and correct data — Practise
  4. Level 3: Missing values, duplicates, validation and cleaning — Practise
  5. Level 4: Sorting, grouping, aggregation and summaries — Practise
  6. Level 5: Read and write CSV files safely — Practise
  7. Level 6: Join tables, merge, concatenate and reshape — Practise
  8. Level 7: Dates, time series, charts and reporting — Practise
  9. Advanced reference: Pandas with SQL (existing lesson, best after the basics)
  10. To infinity (planned): Performance, large datasets, testing, real projects and ML-ready data

Agentic Programming with CSV Files

Learn to coordinate four independent Pandas programs: passed.csv and failed.csv → meritlist.csv → top_ten.csv, plus a separate branch creating files for each failed subject. Includes complete runnable code, fictional data, an inspector, and validation tests.

Intermediate practice: Multilevel CSV Projects

Ready to combine Level 5 CSV input/output, Level 6 merging and Level 7 reporting? Run three six-stage pipelines where the output CSV from one stage becomes the next stage's input. Try student result processing, grocery inventory and competitive exam analysis.

Try before moving on

Create a DataFrame of five books with columns Title, Price and Stock. Find books with a price over ₹300, then reduce the price of one book. Can you do all three without loading a file? Then try finding and correcting missing or invalid prices in Level 3.

Official references: DataFrame fundamentals · Selecting and indexing · Copy-on-Write.

Course indexStart Lesson 0 →