Welcome to Data Analysis with Pandas and Python¶
This repository is a hands-on, self-contained introduction to data analysis with Pandas. It is a rewrite and modernization of a set of beginner course notebooks: every notebook here runs on current Pandas (2.x/3.x), ships with its own data files, and explains what each piece of code does and why it matters.
It is built for a junior developer who knows basic Python and wants to get productive with data analysis — no paid course required.
How this repository is organized¶
Read the notebooks in order. Each one is small and covers one skill. Everything you need to run a notebook is in the same folder as the notebook (or is generated inside the notebook), so you can open any of them and press Run All.
| # | Notebook | What you learn |
|---|---|---|
| 1 | 01_series.ipynb |
Series: creation, attributes, built-in methods |
| 2 | 02_dataframes_1.ipynb |
DataFrames: rows, columns, dtypes, selection |
| 3 | 03_dataframes_2.ipynb |
DataFrames: sorting, ranking, boolean filtering |
| 4 | 04_dataframes_3.ipynb |
Indexing: loc, iloc, missing data |
| 5 | 05_merge_join_concat.ipynb |
Combining datasets |
| 6 | 06_groupby.ipynb |
Split-apply-combine, aggregation |
| 7 | 07_multindex.ipynb |
Multi-level indexes, pivots |
| 8 | 08_date_time.ipynb |
Working with dates and times |
| 9 | 09_text_data.ipynb |
Cleaning and searching text |
| 10 | 10_visualization.ipynb |
Plotting with Matplotlib |
| 11 | 11_input_output.ipynb |
Reading/writing CSV and Excel |
| 12 | 12_read_csv.ipynb |
Reading CSVs in detail |
| 13 | 13_options_settings.ipynb |
Display and global options |
Setup¶
- Create and activate a virtual environment.
- Install the pinned dependencies:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
- Launch Jupyter from the repository root:
jupyter lab
All notebooks were verified with pandas 3.0.x. If you hit a FutureWarning or DeprecationWarning, the code will still run correctly.
Before you start: two concepts that unlock everything¶
1. Two kinds of containers¶
- Series — a single labeled column of values (like a list with names attached).
- DataFrame — a table of rows and columns (like a spreadsheet). A DataFrame is made of Series.
2. The index¶
Every Series and DataFrame has an index — the row labels. The index can be integers (0, 1, 2, ...), dates, names, anything. Two of the most common beginner bugs come from confusing labels (loc) with positions (iloc). You will see both everywhere in the next notebooks.
Let's confirm your environment is ready:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
print("pandas", pd.__version__)
print("numpy", np.__version__)
print("matplotlib", plt.matplotlib.__version__)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import pandas as pd 2 import numpy as np 3 import matplotlib.pyplot as plt 4 ModuleNotFoundError: No module named 'pandas'
How to use this repository¶
- Follow along: run every cell, then change the values to see what breaks. Breaking things is how you learn Pandas.
- Look at the data first: before writing any analysis, always run
df.head(),df.info(), anddf.describe(). - Ask 'what problem does this solve?': every method here exists because real analysis needs it. The notebooks call out the why.
Ready? Start with 01_series.ipynb.