Part of the week 3 assignment of Data Science Track of Coursera