Think Stats 2e

by Allen B. Downey.

Download this book in PDF.

Read this book online.

Code examples and solutions are available from this GitHub repository.

Order the second edition of Think Stats from

Read the related blog Probably Overthinking It.


Think Stats is an introduction to Probability and Statistics for Python programmers.

  • Think Stats emphasizes simple techniques you can use to explore real data sets and answer interesting questions. The book presents a case study using data from the National Institutes of Health. Readers are encouraged to work on a project with real datasets.
  • If you have basic skills in Python, you can use them to learn concepts in probability and statistics.Think Stats is based on a Python library for probability distributions (PMFs and CDFs). Many of the exercises use short programs to run experiments and help readers develop understanding.

This book is under the Creative Commons Attribution-NonCommercial 3.0 Unported License, which means that you are free to copy, distribute, and modify it, as long as you attribute the work and don’t use it for commercial purposes.