%%{init: {"theme":"dark"}}%%
flowchart LR
B[Data Collection]
B --> C[Data Cleaning]
C --> D[Analysis]
D --> E[Visualisation]
Class 1: Introduction to data analysis and inference using Python
October 14, 2026
As scientists, we are exposed to:
How do we make sense of it all?

Data science is an interdisciplinary academic field that uses statistics, scientific computing, scientific methods, processing, scientific visualization, algorithms and systems to extract or extrapolate knowledge from […] data.
The field that combines domain expertise, programming skills, and knowledge of mathematics and statistics to extract meaningful insights from data.
We want this class to be useful for your research!
Try to contextualise the course material to your research:
| Database | What can you find? |
|---|---|
| PANGAEA | About 447,000 datasets: marine geology, geochemistry, palaeoclimate and ecology. Documented datasets with citable DOIs. |
| EarthScope | Continuous seismic records from thousands of stations. 590 TB archived by 2019; over 215 TB of new geophysical data in 2024. |
| NOAA Paleoclimatology | Over 10,000 datasets from ice cores, tree rings, corals and sediments, extending climate records over thousands to millions of years. |
| EarthChem | Geochemical databases searchable by location, age, tectonic setting, sample and composition. |
| IODP³ | Ocean-drilling measurements, images and metadata, normally open after a one-year embargo; physical cores available from repositories. |
| Database | What can you find? |
|---|---|
| Landsat | Over 13.8 PB of imagery since 1972. About 1 TB/day of new observations and 3 TB/day of derived scientific products. |
| Copernicus Sentinel | Radar, optical and atmospheric observations. Sentinel 1 & 2 acquire 4.6 TB/day; the former portal distributed about 590 PB to 750,000 users before closing in 2023. |
| NASA EOSDIS | Observations of the atmosphere, oceans, ice, biosphere and land. Higher-resolution missions drive archive growth and analysis in the cloud. |
| ERA5 | Hourly global climate reanalysis: 200+ variables on an approximately 31 km grid. About 5 PB of native data and 1 PB prepared for distribution. |
| NOAA NCEI | Open weather, ocean, coastal and geophysical archives from historical records, stations, buoys, ships and other observing systems. |
%%{init: {"theme":"dark"}}%%
flowchart LR
B[Data Collection]
B --> C[Data Cleaning]
C --> D[Analysis]
D --> E[Visualisation]
flowchart LR
B[Start]
B --> C["<img src='img/python.png' width='20'>"]
C --> D[End]
Cotopaxi volcano

Example 1: Exploit catalogues of big Earth Observation data

Example 2: Streamline global geochemical analyses
pyrolite
Example 1: In volcanically-active regions, soil burial after explosive eruptions capture more carbon that they emit.
Example 2: In Small Island States, ≥90% of population and GDP is exposed to volcanic hazards.

High-level computing language
Modular
In the code below, we first load the necessary packages and libraries:
matplotlib is the main visualisation package used in Pythonpyplot is a module of matplotlib that provides easy-to-use functions for plotting datafigure is a function of pyplot and is the main function to prepare a plotOption 1: Your own computer
Try this tutorial
Option 2: In the cloud → Google Collab
3 main ways to run Python…
.py scripts from the command line → deprecated.py script using ipykernel → similar behaviour to R/Matlab.ipynb files…in two different environments
| Natural language | Python | Example |
|---|---|---|
| Noun | Object or variable | df |
| Verb | Function or method | mean(), sort_values() |
| Complement | Target variable | "altitude" |
| Adverb | Argument specifying how | ascending=False |
| Sentence | Instruction | df.sort_values(...) |
Python checks the grammar of your code. You must check the scientific meaning of the sentence.
| Task | Questions to ask |
|---|---|
| Load | Where are the data? How do I read them? |
| Inspect | What do the rows, columns and values represent? |
| Select / filter | Which columns and observations do I need? |
| Transform | What should I sort, recode or calculate? |
| Summarise / analyse | What quantity or relationship answers my question? |
| Visualise / export | How should I show or save the result? |
pandas: A package for data manipulation and analysis handling structured data
Similar to Excel → contains tabular data composed of rows and columns
In Excel:
Synthetic dataset of selected volcanic eruptions → first 5 rows:
| Name | Country | Date | VEI | Latitude | Longitude |
|---|---|---|---|---|---|
| St. Helens | USA | 1980-05-18 | 5 | 46.1914 | -122.196 |
| Pinatubo | Philippines | 1991-04-02 | 6 | 15.1501 | 120.347 |
| El Chichón | Mexico | 1982-03-28 | 5 | 17.3559 | -93.2233 |
| Galunggung | Indonesia | 1982-04-05 | 4 | -7.2567 | 108.077 |
| Nevado del Ruiz | Colombia | 1985-11-13 | 3 | 4.895 | -75.322 |
5 modules:
How to do it?