My code for the book Think Stats It's a bit of a mess. I should have used IPython from the beginning.