Open-source project
stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition avatar
stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition

Hands-On Data Analysis with Pandas, 2nd Edition: What the Repository Actually Contains

Materials for following along with Hands-On Data Analysis with Pandas – Second Edition

731 stars1,552 forksJupyter NotebookMIT

At a glance

What is it?
The code repository for Stefanie Molin's Packt book ships twelve chapter directories of Jupyter notebooks, a requirements.txt pinning the library set, and two git tags that freeze the code at publication time. It is a companion to a paid book, not a standalone library, and the material assumes you are reading along.
Who is it for?
Adopt it if you already own the second edition and want the notebooks, datasets and pinned requirements.txt that match the printed chapters, or if you want a free look at chapter 1's python_101.ipynb before buying. Do not adopt it as a maintained pandas reference: the code targets pandas 1.x, the repository has no releases, and the notebook text is written to be read next to the book.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 157 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

A book companion repository, not a pip-installable tool

The repository exists to hold the code for a Packt title published on April 29, 2021. There is no package to install, no importable module, and no CLI. What you get is twelve chapter directories, each holding Jupyter notebooks that correspond to sections of the printed text. The README states the purpose directly: it is "the code repository for my book Hands-On Data Analysis with Pandas." That framing matters for anyone deciding whether to clone it, because the notebooks are written to be read alongside prose you have to buy separately. A notebook in ch_04 does not explain why a rolling window is the right tool; the book does. If you open the repository cold, expect to reconstruct the reasoning yourself from the code and the markdown cells that survived the editing process. The audience is therefore narrow: readers of the second edition, plus anyone evaluating the book who wants to inspect the code before paying. It is not aimed at engineers looking for a pandas utility layer, and it does not pretend to be one.

The twelve-chapter path from DataFrames to anomaly detection

The chapter list is the clearest statement of scope. Chapters 1 through 4 build foundations: an introduction to data analysis and environment setup, then DataFrames, then data wrangling including pulling from an API, then aggregation with merges, rolling calculations and time series. Chapters 5 and 6 cover visualization, first with matplotlib and directly from pandas objects, then with seaborn and customization for presentation-ready output. Chapter 7 is the first applied project, building a Python package for analyzing stocks, and the README links to a separate repository, stefmolin/stock-analysis, for that package. Chapter 8 simulates login attempt data and applies rule-based anomaly detection, again with a linked external repository, stefmolin/login-attempt-simulator. Chapters 9 and 10 introduce scikit-learn and model optimization. Chapter 11 returns to the login attempt data but switches to machine learning anomaly detection. Chapter 12 is a resources chapter with no code of consequence. The arc is deliberate: the same domain problem, authentication logs, appears twice so you can compare a rules approach against a learned one. That comparison is the most interesting structural choice in the repository, and it only works if you actually do both chapters.

Two external repositories carry part of the material

Chapters 7 and 8 depend on code that is not in this repository. The README links to stefmolin/stock-analysis for the stock analysis package and stefmolin/login-attempt-simulator for the data simulation used in the anomaly detection chapters. This is a real coupling: cloning this repository alone does not give you everything the chapters reference. The README does not spell out the install order or whether the external packages are published to PyPI, so the practical step is to read the linked repositories' own instructions before starting chapter 7. It is a reasonable arrangement, since a book chapter about building a package should point at the finished package. It is also a point of fragility, because the external repositories version independently of this one and of the book text. If you are following along page by page, resolve those two dependencies first rather than discovering the gap mid-chapter.

Running the notebooks: Binder, Colab, or a local environment from requirements.txt

The README offers three hosted routes and one local route. The Binder badge points at mybinder.org/v2/gh/stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition/master with urlpath=lab, which opens JupyterLab against the master branch. The Colab badge points at colab.research.google.com/github/stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition/blob/master, and the Nbviewer badge renders the notebooks read-only. For local work, the README points at requirements.txt for the full list of libraries used. The README does not give a pip install line in the excerpt available here, so treat the file itself as the source of truth: inspect it, then install with the tool it was written for. Note that the Binder and Colab links both target master, not the 2nd_edition tag. If your printed copy is the second edition and you want the code as it was at publication, you need the tag, not master. That distinction is easy to miss because the badges are the first thing on the page.

The 1st_edition and 2nd_edition tags are the reproducibility mechanism

The repository keeps two git tags, 1st_edition and 2nd_edition, described in the README as "the materials as they were at time of publishing." This is the only versioning discipline present. There are no releases retrieved, so the tags are the entire stability story. For a book companion that is arguably the right call: the point is to freeze the code so a reader in 2026 sees what a reader in 2021 saw. The cost is that master drifts. The last push to the repository is dated 2026-04-11, which means the default branch has moved since publication. Whether those later commits are typo fixes, dependency bumps, or new material is not stated in the README. If you are debugging a mismatch between your output and the book's, check which ref you are on before assuming the code is wrong.

The pandas 1.x target is the sharpest limitation

The README is explicit about the version story: the first edition used a pandas version "pre 1.0," and the second edition "brings the content up to date with the latest version (1.x)." That was accurate for April 2021. It is not accurate now. Pandas 2.x changed default behaviours in ways that break code written against 1.x, and the README itself directs readers to the pandas release notes to understand what changed between editions, which is a signal that version drift is a known concern in this material. Anyone running these notebooks against a current pandas will hit deprecations or outright errors, and the book text will not explain them because the text predates them. This is the case where the repository is the wrong tool: if your goal is to learn idiomatic pandas as it exists today, a book companion frozen at 1.x teaches you patterns you will then have to unlearn. The mitigation is to pin the environment from requirements.txt rather than installing latest, and to accept that you are learning a specific historical version.

How this differs from a maintained tutorial series

The obvious alternative is the pandas project's own documentation and its user guide, which is versioned with the library and updated as behaviour changes. The difference in approach is structural, not qualitative. The pandas docs are reference material organized by API surface: you look up resample, you read what resample does in the version you have installed. This repository is organized by task sequence: you work through a stock analysis package or a login anomaly detection problem and pick up the API along the way. The docs will always match your installed version; this repository will not. The docs will not give you a twelve-chapter progression from DataFrames to model optimization, and they will not show you the same authentication dataset handled first with rules and then with scikit-learn. If you want currency, use the docs. If you want a guided sequence and accept the version pin, use the book and this repository together. There is little point in using the notebooks without the book, since the explanatory prose lives there.

Licence, maintenance, and what to verify before you clone

The repository is MIT licensed, which permits reuse and modification of the code with the licence and copyright notice retained. That covers the code. It does not cover the book text, the cover image referenced in the README, or the datasets, whose provenance is not described in the material available here. If you intend to reuse a notebook or a dataset in your own teaching or product, confirm the terms for the data separately rather than assuming MIT covers everything in the tree. On maintenance: the repository is not archived and was pushed to in April 2026, but there are no releases, so there is no changelog to read. Upgrading means choosing a ref. Verify three things first: that requirements.txt resolves on your Python version, which ref (2nd_edition or master) matches your printing, and whether the two linked external repositories, stock-analysis and login-attempt-simulator, install cleanly, since chapters 7, 8 and 11 depend on them.

Editorial conclusion

Adopt it if you already own the second edition and want the notebooks, datasets and pinned requirements.txt that match the printed chapters, or if you want a free look at chapter 1's python_101.ipynb before buying. Do not adopt it as a maintained pandas reference: the code targets pandas 1.x, the repository has no releases, and the notebook text is written to be read next to the book. Before cloning, check that requirements.txt installs cleanly against your Python version and confirm which tag, 2nd_edition or master, matches the printing you hold.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition on GitHub
Community notes

Community notes