www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
Why subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print, and bookmark content
- On demand and accessible via a web browser
Acknowledgement
We want to acknowledge the competent and helpful comments and suggestions by Helmut Podhaisky, Halle University, Germany. To have such a partner in the process of writing a book is a big luck and chance for the authors.
We would also like to express our gratitude towards the reviewers of the first edition of this book, , Linda Kann, KTH Stockholm, Hans Petter Langtangen, Simula Research Laboratory, and Alf Inge Wang, NTNU Trondheim.
A book has to be tested in teaching. And here we had fantastic partners: the teaching assistants from the course "Berkningsprogramering med Python" during the years and the colleagues involved in teaching: Najmeh Abiri, Christian Andersson, Dara Maghdid, Peter Meisrimel, Fatemeh Mohammadi, Azahar Monge, Anna-Maria Persson, Alexandros Sopasakis, Tony Stillfjord, Lund University. Najmeh Abiri also tested most of the Jupyter notebook material which you find on the book's webpage.
A book has not only to be written, it has to be published, and in this process Aishwarya Pandere and Karan Thakkar, PACKT Publishing, were always constructive, friendly and helpful partners bridging different time zones and different text processing tools. Thanks.
Claus Fhrer, Jan-Erik Solem, Olivier Verdier Lund, Bergen 2016
Preface
Python can be used for more than just general-purpose programming. It is a free, open source language and environment that has tremendous potential for use within the domain of scientific computing. This book presents Python in tight connection with mathematical applications and demonstrates how to use various concepts in Python for computing purposes, including examples with the latest version of Python 3. Python is an effective tool to use when coupling scientific computing and mathematics and this book will teach you how to use it for linear algebra, arrays, plotting, iterating, functions, polynomials, and much more.
What this book covers
, Getting Started, addresses the main language elements of Python without going into detail. Here we make a brief tour through all. It is a good starting point for those who want to start directly. It is a quick reference for those readers who want in a later chapter understand an example which uses might use constructs like functions before functions were explained in deep .
, Variables and Basic Types , presents the most important and basic types in Python. Float is the more important datatype in scientific computing together with the special numbers nan and inf. Booleans, integers, complex, and strings are other basic datatypes, which will be used throughout this book.