Data science from scratch first principles with Python - Grus, Joel (O'Reilly Media, 2019)
With this updated second edition, you'll learn how many of the most fundamental data science tools and algorithms work by implementing them from scratch.