A Primer on Scientific Programming with Python (3rd Edition)
Tags
Summary
This book is Volume 6 of Springer's Texts in Computational Science and Engineering series. The author, Hans Petter Langtangen, is a professor of computer science at the University of Oslo and director of the Centre for Biomedical Computing at the Simula Research Laboratory, and has long worked on computational science and Python applications. Using an example- and problem-driven approach, the book guides readers with no programming background through an introduction to scientific computing with Python. The 3rd edition was revised and published in 2012; the main text runs about 798 pages and covers computing with formulas, loops and lists, functions and branching, input data and error handling, array computing and curve plotting, files, strings, and dictionaries, an introduction to classes, random numbers and simple games, and object-oriented programming. The book also includes technical appendices on sequences and difference equations, an introduction to discrete calculus, an introduction to differential equations, a complete differential equation project, programming of differential equations, debugging, and migrating from Python to compiled languages. Examples are drawn from mathematics, numerical calculus, statistics, physics, biology, and finance, and nearly every example comes with complete, runnable code. The book particularly emphasizes the contrast between "Matlab-style" procedural code and object-oriented code, showing that Python can serve as a substitute for Matlab in scientific computing. In the preface, the author states that readers need only high school mathematics, and that learning classical and modern single-variable calculus alongside the book is even better.
Editor's review
很多「Python 科学计算」书是从工具库讲起:先装 NumPy、SciPy、Matplotlib,再依次演示 API。Langtangen 这本书走的是另一条路:从最朴素的公式计算和循环写起,让读者先用语言本身把数值过程写明白,再自然过渡到数组计算、类与面向对象,最后落到差分方程与微分方程求解。这种「先造轮子、再用轮子」的编排,对理解科学计算为什么这样写代码极有帮助,也解释了为何它能成为 Springer 计算科学系列中流传最广的教材之一。第 3 版补充了输入数据与错误处理、调试与向编译型代码迁移等工程性专题,全书的示例都配有完整代码,可直接改参数做实验。数学门槛不高,只需要高中数学,但作者反复提示最好同时学一元微积分,说明这本书的野心不止于教语法,而是让读者在编程、数学与具体科学问题三者之间建立联系。若你打算长期做数值计算,这本约 800 页的厚书值得当作案头参考,而不是速成读物。
Who it's for
A good fit for
- 理工科本科高年级或研究生,需要把课程作业与科研计算用 Python 落地的人
- 从 Matlab 转向 Python、希望理解两种写法差异的科研人员与工程师
- 准备开设「科学计算导论/计算物理」类课程、需要现成案例与习题的教师
- 已会 Python 语法,但想系统补齐数值方法与面向对象写法自学者
Not a good fit for
- 零基础且只想快速学会用 pandas 做数据分析的读者,本书不涉及数据清洗与可视化库
- 希望直接学习 NumPy、SciPy、Matplotlib 等库 API 速查的手册型读者
- 英语阅读吃力且需要中文讲解的入门者(本书原文为英文,无官方中文版)
Reading tips
- 按章顺序推进,每章的示例代码亲手敲一遍并改参数,比只读讲解收获大得多。
- 同步补一元微积分与线性代数基础,遇到差分方程与微分方程章节时才不会被数学卡住。
- 把书末的调试与迁移到编译型代码两章当作工程实践手册,做项目时再回头细读。
- 书中代码基于 Python 2 时代环境,练习时注意改成 Python 3 写法,并使用当前版本的 NumPy。
Contents
- Preface
- Computing with Formulas
- Loops and Lists
- Functions and Branching
- Input Data and Error Handling
- Array Computing and Curve Plotting
- Files, Strings, and Dictionaries
- Introduction to Classes
- Random Numbers and Simple Games
- Object-Oriented Programming
- Sequences and Difference Equations
- Introduction to Discrete Calculus
- Introduction to Differential Equations
- A Complete Differential Equation Project
- Programming of Differential Equations
- Debugging
- Migrating Python to Compiled Code
- Technical Topics
- Bibliography
- Index
FAQ
这本书有中文译本吗?
据检索,该书未见正式出版的中文译本,市面流传的多为英文原版 PDF 或影印本。若在合集中看到中文标题,通常是自行翻译的书名,正文仍为英文。
第 3 版和最新的第 5 版有什么区别?
第 3 版出版于 2012 年,正文约 798 页、共 9 章主体加若干技术专题。后续版本在此基础上不断修订,补充更新的 Python 写法与内容。若只求系统学习,第 3 版的主体框架仍适用,但代码风格偏旧。
需要先学 Python 语法再读吗?
不需要。作者明确面向编程新手,从公式计算、循环与列表讲起,逐步引入函数、类与面向对象。具备高中数学基础即可开始,但需注意书中代码多为 Python 2 写法。
书里的数学要求有多高?
作者要求高中数学基础,并建议同时学习经典与现代一元微积分。后半部分的差分方程、离散微积分和微分方程章节会涉及微积分与数值方法概念,数学准备越充分越顺畅。
适合当作课堂教学用书吗?
适合。该书属 Springer 的 TCSE 教材系列,示例与习题丰富,多数高校用作一学期「科学计算/计算物理导论」课程教材,也可作为自学与参考书。
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.