Skip to main content
  • Textbook
  • © 2012

A Primer on Scientific Programming with Python

  • Example-oriented text with all applications taken from science and engineering
  • Aimed at newcomers to programming and Python, but proved to be useful for professionals too
  • All examples are accompanied by complete program codes, which can be modified to the reader's needs
  • Covers both Matlab-style "simple" programming and object-oriented programming
  • Demonstrates how Python can be an alternative to Matlab in scientific computing
  • Includes supplementary material: sn.pub/extras
  • Includes supplementary material: sn.pub/extras

Part of the book series: Texts in Computational Science and Engineering (TCSE, volume 6)

Buy it now

Buying options

eBook USD 59.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (9 chapters)

  1. Front Matter

    Pages I-XXXII
  2. Computing with Formulas

    • Hans Petter Langtangen
    Pages 1-48
  3. Loops and Lists

    • Hans Petter Langtangen
    Pages 49-86
  4. Functions and Branching

    • Hans Petter Langtangen
    Pages 87-135
  5. Input Data and Error Handling

    • Hans Petter Langtangen
    Pages 137-186
  6. Array Computing and Curve Plotting

    • Hans Petter Langtangen
    Pages 187-256
  7. Files, Strings, and Dictionaries

    • Hans Petter Langtangen
    Pages 257-339
  8. Introduction to Classes

    • Hans Petter Langtangen
    Pages 341-412
  9. Random Numbers and Simple Games

    • Hans Petter Langtangen
    Pages 413-481
  10. Object-Oriented Programming

    • Hans Petter Langtangen
    Pages 483-556
  11. Back Matter

    Pages 557-798

About this book

The book serves as a first introduction to computer programming of scientific applications, using the high-level Python language. The exposition is example- and problem-oriented, where the applications are taken from mathematics, numerical calculus, statistics, physics, biology, and finance. The book teaches "Matlab-style" and procedural programming as well as object-oriented programming. High school mathematics is a required background, and it is advantageous to study classical and numerical one-variable calculus in parallel with reading this book. Besides learning how to program computers, the reader will also learn how to solve mathematical problems, arising in various branches of science and engineering, with the aid of numerical methods and programming. By blending programming, mathematics and scientific applications, the book lays a solid foundation for practicing computational science.

Reviews

From the reviews of the third edition:

“A Primer on Scientific Programming with Python simultaneously introduces us to the Python programming language and its use in scientific computing. … The reader will learn good Python programming style from the Primer. The book will often present a direct solution using only the most basic language features … . Those of us who have learned scientific programming in Python ‘on the streets’ could be a little jealous of students who have the opportunity to take a course out of Langtangen’s Primer.” (John D. Cook, The Mathematical Association of America, September, 2011)

“This voluminous book offers an excellent and detailed explanation of programming paradigms and mathematical lexicons. … The author includes many programs, explanations, and exercises. … This book will prove very useful for mathematicians and statisticians. … I definitely recommend this book to university students for a six-month course or classroom discussions. If someone wants to quickly learn Python concepts, it can be used as a reference.” (Naga Narayanaswamy, ACM Computing Reviews, February, 2013)

Authors and Affiliations

  • Simula Research Laboratory, Lysaker, Norway

    Hans Petter Langtangen

About the author

Hans Petter Langtangen is a professor of computer science at the University of Oslo. He has formely been a professor of mechanics and is now the director of a Norwegian Center of Excellence: "Center for Biomedical Computing", at Simula Research Laboratory. Langtangen has published over 100 scientific publications and written several books, including papers and a book on Python's potential for scientific computing. He has also developed open source and commercial software systems for computational sciences.

Bibliographic Information

Buy it now

Buying options

eBook USD 59.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Other ways to access