Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Welcome. This is a hands-on, open textbook about using scientific Python and machine learning to study the Earth and its environment. It is built for a wide range of readers — from someone opening a code editor for the very first time to a researcher who wants to bring modern methods into their work — and every idea is taught against real geoscientific data rather than toy examples, so that you learn each tool in the setting where it is actually used.

Who this book is for

No prior programming experience is assumed. Part I builds Python from the ground up. At the same time, the book is meant to stay interesting for readers who already know how to code: the harder material is always within reach, just one step off the main path. If you have a background in the environmental sciences and want to add computation and machine learning to your toolkit you are in the right place.

How to use this book

Two speeds, one page. The main flow is the core path: read it straight through and you will not miss anything essential. Alongside it you will find collapsible “Going deeper” boxes holding optional material — the why behind the how. Open them when you are curious; skip them with no loss of continuity. This lets the same chapter serve a complete beginner and a motivated reader at once.

Everything runs. Most pages are live notebooks. You can read them here as rendered text and figures, or run them yourself by launching a page in google Colab using the badge icon at the top, or cloning the repository and run it locally. The best way to learn is to change a value, re-run, and see what happens.

Learn against real data. Rather than a new toy dataset per topic, the book keeps returning to real environmental data — near-surface temperature, satellite imagery, hydrological and seismic records — so that methods accumulate into something you could actually use in research.

What’s inside

Before you start

For Part I you need nothing but a web browser; the Google Colab option to run the notebooks requires only a free google account. To run the book on your own machine, you need git and uv — the setup instructions walk you through it. A little familiarity with the command line helps but is not required.


This book is course material for the Machine Learning for Earth and Environmental Sciences course at the University of Lausanne, and is released as an open educational resource. See the repository for license, citation, and acknowledgements.

Authors

Tom Beucler, Milton Gomez, Frederick Iat-Hin Tam, Jingyan Yu, Saranya Ganesh S., Haokun Liu, Kejdi LLeshi, Shivanshi Ashtana, Ayoub Fatihi, Filippo Quarenghi