A blog of Python-related topics and code.
In 2016 it seemed that Cambridge, UK was unusually cold. News reports this year have suggested that April 2017 has been unusually dry. To determine to what extent this is true (again, in Cambridge), I downloaded the monthly weather summaries from the Cambridge University Digital Technology Group. This is easily done using a few lines of bash:
The previous post provided some code for generating Poisson disc noise (in which no point the sample is closer than some fixed distance from any other). Here is a short program to calculate the power spectrum of this noise and compare it with the spectrum for the same number of points drawn from a uniform distribution.
A set of points drawn from a uniform distribution on a two-dimensional domain typically display clustering:
The Digital Object Identifier (DOI) resolution service at doi.org exposes an API for retrieving the BibTeX markup for a reference given its DOI. The following Python 3 script takes a DOI on the command line and returns the BibTeX. For example,