J hooks make evaluating exotic expressions easy

You might see the approximation:

\[\pi \approx 768{\sqrt {2-{\sqrt {2+{\sqrt {2+{\sqrt {2+{\sqrt {2+{\sqrt {2+{\sqrt {2+{\sqrt {2+{\sqrt {2+1}}}}}}}}}}}}}}}}}}\]

and think:

Hmmm! How accurate...

Read More

The intuition behind Expectation Maximisation

Expectation Maximisation is a fantastically useful algorithm used to estimate model parameters (e.g. the bias of a coin, or the mean of...

Read More

100 pandas puzzles

I’ve started compiling a list of short pandas puzzles of varying difficulty. You can find it over on GitHub here.

There are already some great guides to pandas out there (not least in the official documents themselves) but nothing...

Read More

Picking magic numbers for numpy.in1d

If you’ve played about with NumPy before, you’ll probably know that given two arrays of numbers, ar1 and ar2, the function in1d returns a boolean array indicating whether or not each number in...

Read More

Three tactics to boost Stack Overflow upvotes

Stack Overflow, the hugely-popular programming Q&A website, has often been called an online game. To play, you post correct answers or ask interesting questions. Correct and interesting content is upvoted by other users, netting you precious green reputation points.


Read More

Python power towers

If you have a list of numbers, say [3, 2, 2, 2], what’s the best way to turn it into a power tower?

In other words, the aim is to take the list and calculate the answer to...

Read More

A basic introduction to NumPy's einsum

The einsum function is one of NumPy’s jewels. It can often outperform familiar array functions in terms of speed and memory efficiency, thanks to its expressive power and smart loops. On the downside, it can take a little...

Read More

The colour of the Internet

What colour is the Internet? Probably green or blue, judging by the colours that appear most often in domain names.

The graph below shows 12 colours and the number of times each one appears in .com and .net domain names....

Read More

Future Plans


Whenever I stumble across something interesting and I can condense it into a short blog post, it will go on this site.


Read More