To get the most out of this book
You will need to have a basic knowledge of Python. We don’t assume any knowledge of mathematics, although if you are familiar with some basic mathematical concepts, you will better understand the context and details of the techniques we discuss.
The only requirement throughout this book is a recent version of Python – at least Python 3.6, but higher versions are preferable. (The code for this edition has been tested on Python 3.10, but should work on earlier versions too.) You might prefer to use the Anaconda distribution of Python, which comes with many of the packages and tools required in this book. If this is the case, you should use the conda
package manager to install the packages. Python is supported on all major operating systems – Windows, macOS, and Linux – and on many platforms.
The packages that are used in this book and their versions at the time of writing: NumPy 1.23.3, SciPy 1.9.1 Matplotlib 3.6.0, Jax 0.3.13 (and jaxlib 0.3.10), Diffrax 0.1.2, PyMC 4.2.2, pandas 1.4.3 Bokeh 2.4.3, NetworkX 3.5.3, Scikit-learn 1.1.2, StatsModels 0.13.2, Shapely 1.8.4, NashPy 0.0.35, Pint 0.20.1, Uncertainties 3.1.7, Xarray 2022.11.0, NetCDF4 1.6.1, Geopandas 0.12.1, CartoPy 0.21.0, Cerberus 1.3.4, Cython 0.29.32, Dask 2022.10.2.
Software/hardware covered in the book |
Operating system requirements |
Python 3.10 |
Windows, macOS, or Linux |
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
You may prefer to work through the code samples in this book in a Jupyter notebook rather than in a simple Python file. There are one or two places in this book where you might need to repeat plotting commands, as plots cannot be updated in later cells in the way that is shown here.