A blog of Python-related topics and code.

New York Times Spelling Bee solver

The New York Times publishes a daily puzzle, Spelling Bee, in which players must find as many words as possible using seven letters arranged in a hexagon. Each letter may be used any number of times but the solution words must be at least four letters long and must include the letter at the centre of the hexagon.

QR Codes and the Game of Life

The following code identifies a QR code in a provided image and plays John Conway's Game of Life with it. It uses OpenCV (for image recognition and QR code detection), along with SciPy, NumPy and Matplotlib. If you don't have them, they can be installed with

The Weierstrass function

The Weierstrass function, named after the German mathematician Karl Weierstrass (1815 – 1897) is a real-valued function that is continuous everywhere but nowhere differentiable. It is usually expressed as a Fourier series:

Visualizing the Temperature in Cambridge, UK

The Digital Technology Group (DTG) at Cambridge University has been recording the weather from the roof of their building since 1995. The complete data are available to download in CSV format from the DTG website as the file weather-raw.csv.

A "universal" formula for egg shape

A recent article, Narushin et al., "Egg and math: introducing a universal formula for egg shape", Ann. N.Y. Acad. Sci. 1505, 169 (2021) introduces a "universal" formula for the shape of eggs, including "pyriform" (pear-shaped) eggs such as those of the guillemot – supposedly, such eggs roll in a circle when disturbed so that they do not fall off the cliffs where these birds nest.