Because let’s face it: If you’re a hobbyist without a stream of gnarly problems that Python is uniquely equipped to solve, you won’t use what you learn. That was absolutely my challenge back in the early days of the modern WWW; Python was useful in a few select ways, but hobbyist projects (much less mainstream applications) were few and far between. Doing Math With Python is great for gaining a very basic understanding of Python and quickly turning that into something with real-world application. Along the way, you’ll deepen your skills in the language. That said, this book isn’t the easiest way to do your high school math homework, so it’s probably best suited to the hobbyist developer who wants one stone to kill two birds. And after all, learning more advanced math skills is fuel to the fire in terms of mastering some more advanced programming concepts.
With all those caveats out of the way, a bit about how Doing Math With Python is structured. Mentioned before briefly, but worth stressing, is that you’ll benefit from at least some rudimentary understanding of Python prior to reading this book. Even a quick read of the Beginner’s Guide at python.org will help you grasp the fundamentals of the language. Doing Math With Python dedicates just a few pages to remedial language concepts before jumping into writing full programs. The same is true of math skills. If you’re not waist deep in at least Algebra II or something more advanced, you’re going to spend more time scratching your head than learning useful lessons. It’s true that you can at least copy the examples from the book, but the key to really making the most out of Doing Math With Python is coming in with a solid understanding the math concepts so you, in turn, can understand what Python adds to the equation.
Doing Math With Python spends a good amount of time on the command line and text-based examples early on, showing at first how the interactive shell can be used like a calculator on steroids. You’ll quickly see how thinking of Python like a calculator is like using a Formula-1 race car to drive a few blocks and pick up groceries… The book quickly jumps from command-line exploration to writing simple programs that grab user input and use simple concepts like modules, classes, variables, and loops to perform tasks that would otherwise be incredibly time consuming by hand or with a calculator. This is still just a fraction of Python’s true power, of course. Subsequent chapters build on your nascent programming skills by exploring how Python visualization can help you create charts, graphs, and plots. At this point, we’re entering the realm of things that you could do in a spreadsheet, but with relatively limited flexibility. Halfway through the book, Doing Math With Python has given you command of Python as a tool for automating some relatively complex algebra and statistical scenarios, and this is picked up on later with visual exploration of geometry.
Specialized topics and specialized tools in Python are addressed, and always with a nod toward cross-platform development. Too many times we’ve seen books that assume you’ll be working on a single platform, but one of the basic tenets of Python is that it can be run on almost anything. New tools are accompanied by an explanation of how to install and use them, whether at a command-line/module/library level, or standalone products like Anaconda. More advanced math topics are also covered, all the way up to calculus and probability. The core of the pedagogy behind Doing Math With Python feels like algebra, which is a good thing since that should at least apply across every high-school equivalent math program.
If you’re not a high-school math student, teacher, or parent, there are a few reasons this book may appeal to you. It’s a terrifically practical way to jump into programming Python and has some especially nice points connecting the work you do here to the kind of analysis you might be called on to do in a business or research setting. Not to say this is required reading for future data scientists, but it’s recognition that the world of Python has moved way past parsing log files and creating simple interactive CLI programs. It’s not the shortest distance between your budding math student and completing her homework, but it has the potential to make math seem a lot more interesting. At the very least, your understand of math concepts will deepen, and along the way you’ll be learning a hugely popular–and practical–programming language.