My code from The Data Scientist's Toolbox class on Coursera