Skip to content
Jupyter Notebooks derived from Allen Downey's book Think Bayes.
Jupyter Notebook TeX Python Other
Branch: master
Clone or download
Pull request Compare This branch is 10 commits ahead, 16 commits behind AllenDowney:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
book Adding book Jul 23, 2015
code Fixed formatting issue with notebooks. Feb 25, 2016
.gitignore Converted chapters 4-7. Start on chapter 8. Aug 5, 2015 Expanded binder instructions Feb 25, 2016


Launch now and run interactively by clicking this badge, then navigate to the \notebooks directory and open the notebook corresponding to the chapter you want to read: Binder

This material was adapted from Allen Downey's Think Bayes Github repository by Roger Labbe.

Mostly I took his code and tex file and converted them into a series of Jupyter notebooks. This was sometimes problamatic. Allen uses a lot of Python classes, and his exposition splits the code across multiple paragraphs. It's a great pedagogical technique, but does not cleanly work in notebooks, where you have to specify the entire class in one cell. Furthermore, most of his code is in .py files.

I made this work as best I could, but sometimes there were authorial decisions that I do not feel comfortable making. The code just doesn't run in those spots. Sometimes I left the code in markdown cells rather than putting it in code cells, and then imported the class from the .py file. I kind of figured this out as I proceeded, so perhaps there are stylistic differences in the back vs the front of the book.

He generates many graphs, but does not supply the source code. Maybe the code is in the /code subdirectory? In a few places I took the liberty of supplying the Python, but in many places I did not. Maybe somebody else will feel like doing that; I don't really have time right now. Pull requests accepted!

There are several places in the text where it was not clear to me where he got his datasets. Rather than making something up, I just let the code cells fail to execute. I hope Allen will help me rectify these situations. If not, and there is enough interest, we can make some decisions and get the cells working.

I put his code in a /code subdirectory. I did not fix the references in the book, which specify going to his home page to get the code. Again, I wanted to make as few editorial decisions as possible.

I did alter most of the code to work with Python 3. Mainly by using

from __future__ import print_function

but in a few places I had to fix things like removing xrange or iterkeys(). I only did just enough work to get it working.

His original README is:

Code repository for Think Bayes: Bayesian Statistics Made Simple by Allen B. Downey

Available from Green Tea Press at

Published by O'Reilly Media, October 2013.

You can’t perform that action at this time.