Answers Question 2 of the data scientists toolbox course in Coursera