from chrisclark's Python for Data Science repo