Open-source project
AllenDowney/ThinkStats avatar
AllenDowney/ThinkStats

ThinkStats ships the same notebooks twice, and dropped Git LFS in June 2025

Notebooks for the third edition of Think Stats

1,287 stars204 forksJupyter NotebookMIT

At a glance

What is it?
The ThinkStats repository holds the notebooks, data and build tooling for the third edition of the book, with a solution and a no-solution copy of every chapter, a Jupyter Book build, Conda environments and a Makefile whose targets cover linting, tests and publishing. Data files now live directly in Git instead of Git LFS.
Who is it for?
Use this repository if you are working through Think Stats and want the code to run rather than to be read, since the notebooks, the datasets and a one-command environment all sit in one place and the data no longer needs Git LFS. Do not adopt it as a library, because nothing here is installable and the tools are there to build the book rather than to be imported.
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 8 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 October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Two copies of every chapter, and only one of them is the source

The repository is not a code library. It is the teaching material for the third edition of the book, and its most important structural decision is that the same notebooks are stored twice.

The nb directory holds notebooks without solutions and the soln directory holds notebooks with solutions, with the README stating that the ones in soln are the source files. That relationship explains the rest of the tooling. The Makefile has an update-chapter target that rebuilds one chapter from markdown, taking a CHAPTER variable that defaults to chap07, and an md-from-ipynb target that exports missing soln/*.md files from existing notebooks. Markdown in soln is therefore generated output, and a contributor who edits it by hand loses the change on the next build.

The division is a teaching decision rather than a technical one. The no-solution copy is what a reader runs, and the solution copy is what the author writes and derives from.

For a user who does not want to clone anything, two archives sit at the repository root. ThinkStats.zip contains the notebooks without solutions and ThinkStatsSolutions.zip contains them with solutions, and the README describes the first as the download if you just want to run the notebooks.

The default branch is v3, not main, which is a small thing that will confuse anyone arriving from a link written for a different edition.

Git LFS was dropped in June 2025, and the data is now in the repository

There is a short note for users of earlier editions, and it is the most consequential operational change in the repository.

Older versions of this repository used Git LFS to store the data files. As of June 2025, the README states that all data files are included directly in Git to simplify access.

The effect is larger than it sounds for anyone cloning. With LFS, a clone without the LFS client installed, or without the smudge filter configured, produced pointer files instead of data, and every notebook that read one failed. Removing LFS removes that failure mode and the setup step, at the cost of a larger working tree and a history that carries the data.

That trade is why the data directory is listed as a first-class part of the project rather than a download. The data directory holds the data files used in the book, and the notebooks read them by relative path, so a reader who wants to reproduce a figure needs the repository as it now stands rather than the LFS era layout.

The other top-level directories are easier to skim. examples/ holds notebooks with additional examples, and it is where the material is most interesting if you are not following the book chapter by chapter: binom_skeet, fourier, moneyline, resampling_animation, ripoff_etf, temperature and variability, each present as both an .ipynb and a .md. figs/ holds figures not generated in the notebooks, jb/ is where the HTML version of the book is built with Jupyter Book, and tutorial/ contains notebooks on time series analysis.

The Makefile is a full authoring toolchain, not just an installer

The Makefile does far more than create an environment, and its target list is the clearest description of how this project is maintained. Python 3.12 is pinned as the version and the environment name is the project name.

Creating the environment is one target:

make
create_environment:
	mamba env create -f environment.yml

with a development variant that layers environment-dev.yml on top, and update and delete targets that use --prune to remove packages that have left the environment file. A reader who follows the README's Setup section is pointed at the Makefile, requirements.txt and requirements-dev.txt, so the environment file and the pip requirements files are two descriptions of the same dependency set.

The quality targets are the part most repositories of this kind lack. lint runs flake8 and black in check mode, format runs black to rewrite, and tests runs pytest. There is also a clean target for temporary files and caches.

Two targets describe the publishing path. md-from-ipynb regenerates the markdown in soln, and publish-html builds the Jupyter Book and pushes it to gh-pages, which is how the book ends up readable online at the project's GitHub Pages address.

The dependencies in requirements.txt also describe the subject area rather than the tooling: numpy, scipy, statsmodels, sympy, pandas-adjacent tables, seaborn and matplotlib for the figures, lxml and html5lib for the data cleaning, jupyter to run any of it, plus empiricaldist and statadict, which are the author's own supporting packages.

Running the notebooks versus reading the book

The README's first substantive link invites the reader to read the book online and run the notebooks at the same time, which is the intended use and the one the tooling supports.

The book itself is built by Jupyter Book from the jb/ directory, and the published version lives on gh-pages. The repository therefore contains both the reading experience and the computing environment, and the two are versioned together on the v3 branch.

For someone who already owns the book in another form, the question is what running the notebooks adds. The answer is that the data is real rather than illustrative, and the transformations are visible. moneyline and ripoff_etf are the two that stand out for a working reader, since they involve loading and cleaning real-world data rather than a distribution generated for the page, and resampling_animation deals with a method that is easy to describe and hard to see.

The project also carries a PROJECT_BOARD.md at the root and a scripts/ directory, which together suggest the work is tracked as an ongoing project rather than a frozen artefact tied to a single printing.

One practical note for anyone planning a teaching use: these are notebooks with solutions present in the same repository, so a class that hands out the no-solution copy should be aware that the answers are one directory away.

Licence, cadence and what is not here

The repository carries a LICENSE file at the root and the project is MIT licensed, which for teaching material means you can reuse the notebooks and the data in a course or a book of your own. No legal advice is offered, but reuse must follow the MIT licence, including its copyright and licence-notice requirements.

The last push was on 2026-10-15, and the repository is not archived. There are no GitHub releases, which is expected for a book repository where the version is the edition and the branch, not a tag.

What is not in the repository is worth stating. There is no test suite for the analysis itself, only the pytest target that the Makefile exposes, and the repository does not say what that target covers. There is no pinning of the exact package versions in requirements.txt, so an environment created today may differ from the author's, and the Conda environment files are the more reliable reference for reproducibility. The tutorial directory on time series analysis is described as a tutorial rather than a book chapter, so it is the part most likely to be revised without a corresponding change in the main text.

For an author considering the same structure, the transferrable parts are the two-copy chapter layout with generated markdown, the authoring targets for linting and tests, and the decision to commit data rather than keep it behind a LFS pointer.

Editorial conclusion

Use this repository if you are working through Think Stats and want the code to run rather than to be read, since the notebooks, the datasets and a one-command environment all sit in one place and the data no longer needs Git LFS. Do not adopt it as a library, because nothing here is installable and the tools are there to build the book rather than to be imported. Verify first which branch you are on, since the default is v3 rather than main, and run the Makefile environment targets before the first notebook so the pinned Python 3.12 environment matches what the author used.

Frequently asked questions

How do I get the ThinkStats notebooks without cloning the repository?

Two archives are provided at the repository root. ThinkStats.zip contains the notebooks without solutions, which the README describes as the download for running the notebooks, and ThinkStatsSolutions.zip contains them with solutions.

Do I still need Git LFS for the ThinkStats data files?

No. The README states that older versions of the repository used Git LFS for data files and that as of June 2025 all data files are included directly in Git to simplify access.

How do I set up the environment for the ThinkStats notebooks?

The README points at the Makefile, requirements.txt and requirements-dev.txt. The Makefile's create_environment target runs mamba env create with environment.yml, and create_environment_dev layers environment-dev.yml on top of it.

What is the difference between the nb and soln directories?

nb holds notebooks without solutions and soln holds notebooks with solutions, which the README identifies as the source files. The Makefile regenerates the markdown in soln from those notebooks.

Official sources

  1. AllenDowney/ThinkStats on GitHub
  2. Issues
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/allendowney-thinkstats.svg)](https://hysenlabs.com/projects/allendowney-thinkstats)