IPython Notebook solution to https://www.coursera.org/course/datan