A blog of Python-related topics and code.

Raincloud plots comparing rainfall in Wales and East Anglia

As a companion script to this one on UK monthly temperatures the Met Office's data on rainfall can be compared in a similar way. The script below produces "raincloud" plots of the monthly rainfall since 1891 for two regions of the UK: East Anglia (relatively dry) and Wales (notoriously wet). The "cloud" for each month is a kernel density estimate of the distribution of the number of days on which at least 1mm of rain falls; the "rain" is a histogram of the same data.

Ridgeline plots of monthly UK temperatures

The UK Meteorological Office offers historical data of mean monthly temperatures in different regions of the UK for download. For the purposes of this blog post, I downloaded the data corresponding to two regions: Scotland.txt and South_England.txt.

Linear least squares fitting of a two-dimensional data

This earlier blog post presented a way of performing a non-linear least squares fit on two-dimensional data using a sum of (2D) Gaussian functions.

Least-squares fitting to an exponential function

Many phenomena can be described in terms of a measured variable varying exponentially with a quantity. For example, a processes such as radioactive decay and first-order reaction rates are described by an ordinary differential equation of the form

An Arepo (Latin Wordle) Solver

Arepo is a word-guessing game like Wordle, but in Latin. Therefore, the Wordle-solving script presented previously can be used to solve Arepo problems, but a list of five-letter Latin words is required.