If you can put a formula in a spreadsheet but want to run it on a whole set of measurements, Joakim Sundnes’s Introduction to Scientific Programming with Python is a useful place to start. It teaches programming through numerical problems rather than web apps. You do not need to know Python already, but you will get more from the examples if you are comfortable reading a formula. The complete book is free to download from Springer (PDF).
Which chapters should you start with?
- If this is your first program: start with “Getting Started with Python” and “Computing with Formulas” (pp. 1–17). Then read “Loops and Lists” to move from calculating one value to processing a series.
- If you already write scripts: try “Arrays and Plotting” (pp. 81–100). The useful shift is from visiting numbers one by one to expressing an operation on an entire array. Go back to “Functions and Branching” if you find yourself copying the same calculation into several places.
- If your code works only on tidy examples: read “User Input and Error Handling” (pp. 57–80). A formula can be right even when the program is wrong about what its input means.
Try it: one formula, three measurements
Here is an original exercise to try alongside the book. A counter records its total at one-second intervals. How much did the count change in each interval? Use adjacent readings, not the average of the totals:
counts = [100, 104, 111, 115]
changes = [after - before for before, after in zip(counts, counts[1:])]
print(changes) # [4, 7, 4]Four readings give three changes. Because the spacing is one second, those numbers are also rates in counts per second. If the readings arrive at irregular times, subtraction still gives the change, but you must divide by the actual elapsed time to get a rate. That distinction is worth checking before you plot the result.
Is it the right book for machine learning?
Choose it if lists, functions, arrays or plots are the part of a machine learning example that slows you down. The final chapters also introduce classes and object-oriented programming. If you already use those tools and want to train and evaluate a model today, skip ahead to your first machine learning model in Python. This book is a foundation for that work, not a guide to choosing classifiers.
Edition, open access and Kindle
This guide covers the 2020 edition by Joakim Sundnes, volume 6 of Simula SpringerBriefs on Computing. The publisher’s book page lists all nine chapters and the electronic ISBN 978-3-030-50356-7. The book is licensed under Creative Commons Attribution 4.0 International; check individual credit lines for exceptions covering third-party material.
You do not need to buy the Kindle edition to read the book. If you prefer that format, the following is a paid link. As an Amazon Associate I earn from qualifying purchases.



