J hooks make exotic expressions easy
You might see the approximation:
and think:
Hmmm!...
Haphazard investigations
You might see the approximation:
and think:
Hmmm!...
There are 12 unique permutations of the word ‘food’. Of these, there are only six that satisfy the constraint that no adjacent...
Expectation Maximistation is a fantastically useful algorithm used to estimate model parameters (e.g. the bias of a coin, or the mean of...
The inverse square root of a number x is x-1/2. For example, put in 25, you’ll get back 0.2: the square root of 25 is 5, the inverse of 5 is 1/5, or 0.2 in decimal notation. It’s a very...
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...
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...
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.
The...
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...
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...
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....
There are over 130 million .com and .net domain names. Is every single English word being used?
Curious, I hatched a plan and found the answer: not at all.
By my reckoning, only around 64% of all recognisable English...
Welcome!
Whenever I stumble across something interesting and I can condense it into a short blog post, it will go on this site.
Alex