Python is a computer programming language that has gained popularity throughout the sciences. This fully updated second edition of A Student’s Guide to Python for Physical Modeling aims to help you, the student, teach yourself enough of the Python programming language to get started with physical modeling. You will learn how to install an open-source Python programming environment and use it to accomplish many common scientific computing tasks: importing, exporting, and visualizing data; numerical analysis; and simulation. No prior programming experience is assumed.
This guide introduces a wide range of useful tools, including:
- Basic Python programming and scripting
- Numerical arrays
- Two- and three-dimensional graphics
- Animation
- Monte Carlo simulations
- Numerical methods, including solving ordinary differential equations
- Image processing
Numerous code samples and exercises—with solutions—illustrate new ideas as they are introduced. This guide also includes supplemental online resources: code samples, data sets, tutorials, and more. This edition includes new material on symbolic calculations with SymPy, an introduction to Python libraries for data science and machine learning (pandas and sklearn), and a primer on Python classes and object-oriented programming. A new appendix also introduces command line tools and version control with Git.
Jesse M. Kinder is associate professor of physics at the Oregon Institute of Technology. Philip Nelson is professor of physics at the University of Pennsylvania. His books include From Photon to Neuron (Princeton), Physical Models of Living Systems, and Biological Physics.
Praise for the previous edition"At a brief 160 pages, it is quite possible for a motivated student to complete it in just a few sittings. . . . A fine introduction." —American Journal of Physics
"The text serves as an excellent stepping stone into the world of using Python in computational science for undergraduate students with a strong background in mathematics."—Kevin Thielen and Vivienne Tien, Computing in Science & Engineering
"Kinder and Nelson's engaging introduction to scientific programming in Python is careful and thorough, and focuses on actual essentials. Bread-and-butter concepts and techniques, belonging in every computational scientist's toolbox, are presented with well-thought-out examples drawn from daily research practice. This is a clever text, inviting students to take that most important step: to dive right in and start coding."—Cornelis Storm, Eindhoven University of Technology
"Kinder and Nelson have written a friendly and succinct, yet surprisingly comprehensive, introduction to scientific programming in Python. It's written not just for computational scientists, but for anyone who needs to plot and analyze experimental data, numerically solve equations, or learn the basics of programming. Even students who have experience in programming will appreciate the thought-provoking exercises and guidelines for getting the most out of Python."—Vinothan N. Manoharan, Harvard University
"This book is tailor-made for physical scientists beginning to do computation. More than in any other programming book I've read, the authors are conscientious—they anticipate and troubleshoot the areas of confusion readers might encounter. Kinder and Nelson carefully and effectively guide readers toward the goal of formulating a computational problem and solving it."—Justin Bois, California Institute of Technology
"Like patient driving instructors, Kinder and Nelson guide the hands of novice programming students from the get-go, helping them to avoid obstacles and crashes. By the end of the book, students should be racing around confidently like pros, using Python to solve scientific problems of data analysis, modeling, and visualization. A great textbook for a first course in modern scientific programming in any context, and one that I'll be using myself."—Garnet Kin-Lic Chan, Princeton University
"This book covers the basics of Python programming language, with an emphasis on physical modeling. It provides a very useful introduction to Python for undergraduate students and others who have never programmed before."—Željko Ivezić , University of Washington
"This is an excellent introductory text, aimed at those with little to no experience in programming. In a clear and concise manner, the authors cover or touch upon all the important aspects of computational science in Python. They guide readers by explaining how to best perform certain common tasks in scientific computing. The book's examples and user exercises are well selected."—Quentin Caudron, Princeton University