-
Leetcode – 3sum
Well… I wasn’t born with the talent of a premiership footballer, so this will likely be the only 3sum I get. This is another Leetcode problem, it builds upon the 2sum example (see the previous post) but adds one more number (obviously) and some more conditions, which significantly increase the difficulty of the problem being…
-
Leetcode – 2sum
After a period of inactivity due to working full time on a project (this was enough coding for me), I am back writing some articles. After a week and a half away from work over the Christmas period I quickly fell into the familiar seasonal pattern of not really knowing what day it is, with…
-
Databricks – Mounting Storage and Importing Files
Introduction In my last post (Learning Databricks – Accessing a Data Lake Using a Service Principal – Cookie Codes). I described the process for setting up a Service principal in Azure and how you can store its credentials securely and access them via Databricks. This post is going to continue from this point and use…
-
Machine Learning – Predicting Fatalities on the Titanic
Introduction This is a sequel to a post I wrote on the Data Analysis of deaths on the titanic and any correlations that can be drawn from them. I recommend you read that post before you read this one. The aim of this post is to use the same dataset to build a model that…
-
Iceberg Right Ahead – Analysing Titanic Survival Chances
Introduction The Sinking of the titanic is one of the most famous events of the last century. The “unsinkable” ship sinking on its maiden voyage was a truly humbling event and the introduction of radio / telegram at the time allowed the story to be relayed around the world. Datasets detailing the list of passengers…
-
Turtle – Learning to code with drawings
Introduction I am currently stuck indoors suffering with Covid, this is especially unfortunate as I am overseas on holiday, with few better options I decided to play around with the Python Turtle library. What is Turtle? When I was at school (a long time ago) there was a language we used on the computers called…
-
Unstructured Data to Structured – JSON Normalisation
Introduction I had a job interview today and one of the topics that was raised was importing JSON based data (which can be considered as unstructured) into a table format (structured). I offered a few ways of how this could be done and I think answered the question appropriately, but the interviewer said a number…
-
Benford’s Law
Introduction Let’s speculate on a distribution involving the population of cities. We will look at only the first digit of the population size. So for example greater London has 9 million people living in it. the first digit is therefore 9. If we took the first digit of each capital city, how do we think…
-
Cracking Wordle
In my previous post. I explained how you can code the NY Times puzzle game Wordle in Python. I recommend reading the previous post (Coding Wordle) if you are unfamiliar with how Wordle works. My sister is a fan of this puzzle and told me she could only play it once a day on the…
-
Coding Wordle
Christmas is a strange time of the year, often you feel like you’ve gone from rushing around in chaos to sitting down with little to do. My Christmas is often like this. This year my sister was doing an online puzzle called Wordle but having completed it I asked – is that it? To which…
-
Creating a Classic – Snake
I once owned a Nokia 3310 (showing my age a bit here). This phone was and still is class for several reasons; Now obviously compared to modern games Snake is rubbish, but as a kid in school in the late 90’s it was class. How Does the Game Work Snake is a really basic game.…
-
You are Better at Maths Than a Computer
Ok… this claim is a bit tongue in cheek but let me demonstrate one way of how you are “better at maths” than a computer. Let’s consider the following piece of code in Python. What do you expect to be printed (0.1+0.2)?0.3 right? we know 0.1 + 0.2 = 0.3.Well……………… The output of this code…
-
Is the Lottery Fair?
We all dream of winning the lottery and the life changing opportunities this would give us, the houses, cars and holidays. But how likely are you of winning the lottery if every number drawn is random? And how do we know it is a random chance? are there potentially exploits where some numbers are more…
-
Data Analysis – Airbnb in London
Let’s for a minute imagine a wonderful parallel universe – where a decision I need to make is where should I buy a property in London to rent out on Airbnb (for those that don’t know me this is about as far fetched as it gets). How could we do this? We would need some…