Main Content

Introduction to Scientific Programming with Python

This book was originally written as a set of lecture notes to the book A Primer on Scientific Programming with Python by Hans Petter Langtangen1, and can be used either as a supplement to that book or on its own, as a compact introduction to scientific programming. Langtangen’s book and these lecture notes, have formed the core of an introductory course on scientific programming at the University of Oslo (INF1100/IN1900, 10 ETCS credits). The course has been running since 2007 and is primarily taken by first-year students of mathematics, engineering, physics, chemistry, and geosciences.

The writing of these lecture notes, and their subsequent evolution into a book, were primarily motivated by two factors. The first was that many students found the nearly 1000 pages of Langtangen’s book a bit overwhelming as a first introduction to programming. This effect could be mostly psychological, since the book is well structured and suited for selective study of chapters and sections, but the student feedback from students still indicated the need for a more compact and (literally) lightweight introduction. The second factor was that, sadly, Hans Petter Langtangen passed away in 2016, and his book has therefore not been updated to the newest versions of Python and the various tools introduced in the book. This issue could also be mostly a mental obstacle, since the differences between the Python versions are quite small, and only minor edits are needed to make most of the examples from the original book run on the newest Python platform. However, the book is intended as an introduction to programming, and when learning an entirely new topic, any minor inconsistency is a potential source of confusion. I therefore saw the need for an updated document where all the code examples would run without any modifications on the most common Python platforms. That said, in spite of these minor shortcomings as an introductory text, Langtangen’s book is still an excellent resource on scientific programming in Python. Compared with the present book, it covers a much broader set of topics and includes more examples, more detailed discussions and explanations, and many more useful programming hints and tips. I highly recommend it as a supplement to these notes for anyone with ambitions to become an expert scientific programmer. “

Link to article