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.
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.
| Row | Name | City | Marks | FeePaid |
|---|---|---|---|---|
| 0 | Asha | Varanasi | 88 | True |
| 1 | Ravi | Ranchi | 42 | False |
| 2 | Meera | Varanasi | 76 | True |
| 3 | Kabir | Patna | 91 | False |
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
Build tables directly using dictionaries and lists. Understand rows, columns and indexes.
New learners · 15–25 minutesLesson 1Search and selectFind students by name, marks or city. Master .loc, .iloc and filters.
Data lookup · 20–30 minutesLesson 2Change values safelyCorrect marks, update several rows, add columns and grow your table.
Data editing · 20–30 minutesLesson 3Clean messy dataDetect missing values, remove exact duplicates, fix text and numeric types and validate scores with an audit.
Data cleaning · 35–45 minutesLesson 4Sort, group and summariseCreate leaderboards, city averages and multi-column reports with groupby(), agg() and transform().
Data analysis · 40–50 minutesLesson 5Read and write CSV filesImport 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 minutesLesson 6Merge, join and reshapeCombine related tables safely with merge(), join() and concat(), then reshape data using melt(), pivot() and pivot_table().
Data relationships · 45–60 minutesLesson 7Dates, time series and reportingParse dates, resample timelines, calculate rolling metrics, build charts and export useful reports.
Time analysis · 50–70 minutesThe 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.
- Level 0: Create DataFrames without files — Start
- Level 1: Search, select and filter — Learn
- Level 2: Change and correct data — Practise
- Level 3: Missing values, duplicates, validation and cleaning — Practise
- Level 4: Sorting, grouping, aggregation and summaries — Practise
- Level 5: Read and write CSV files safely — Practise
- Level 6: Join tables, merge, concatenate and reshape — Practise
- Level 7: Dates, time series, charts and reporting — Practise
- Advanced reference: Pandas with SQL (existing lesson, best after the basics)
- 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.