FORMULA 1 STORIES : SAUDI ARABIA GP #1

Rajaah Dhananjey
6 min readMar 27, 2022

--

Qualifying stories : Part 1 (Powered by FastF1 for python)

Part 0 : Preface — Where do I get the data?

When it comes to most competitive sports, detailed data is hardly available, beyond the broad summary level statistics.

Cricket for instance has data available limited to ball by ball event information. Football is for the most part even more limited, with event and tracking data very hard to come by.

Fortunately, F1 has a savior — there is an API available called ergast which provides historical data for formula 1 right from the 1950s. It even has the ability for non-programmers to query and retrieve the data in the form of spreadsheets.

The API supports XML, JSON and JSONP response formats and there is a lot of documentation provided on the website as to how to fetch data.

But there is a very neat tool available to avoid all the api fetching and instead, get the data in a ‘ready-to-cook’ format for data analytics. It’s called Fast F1. It builds on top of the ergast api and it enables anyone with a basic knowledge of only Python to be able to fetch and work on detailed telemetry data for any event and any session.

Part 1 : Fetching and collecting the required data

A detailed documentation webpage is available , it’s very easy and straightforward to start.

Let’s start by importing the event of Saudi Arabia GP

Enabling the cache is very important to avoid load on the server and makes it so that you only need to be connected to the internet once. Also, you get a lot of warnings if you do not have a cache folder set up.
RoundNumber                                                    2
Country Saudi Arabia
Location Jeddah
OfficialEventName FORMULA 1 STC SAUDI ARABIAN GRAND PRIX 2022
EventDate 2022-03-27 22:00:00
EventName Saudi Arabian Grand Prix
EventFormat conventional
Session1 Practice 1
Session1Date 2022-03-25 17:00:00
Session2 Practice 2
Session2Date 2022-03-25 20:00:00
Session3 Practice 3
Session3Date 2022-03-26 17:00:00
Session4 Qualifying
Session4Date 2022-03-26 20:00:00
Session5 Race
Session5Date 2022-03-27 20:00:00
F1ApiSupport True

You get the full details of the event . This is not as useful though. Let’s move on to the real deal — loading the qualifying session data

If you had the cache enabled, it will directly fetch the data from your cache — neat!

Part 2 : Data Analysis Yay!

For this post, I am trying to answer the following question : Which cars hold a top speed advantage? Remember McLaren’s rocket ship in 2021.

There we have it — the Speed at Speed Trap (SpeedST) and the Driver name (Driver)

A quick glance at the data frame shows us the two columns we need SpeedST and Driver .

Let’s start by using the lap data to extract the top speed for each driver. We can do that by finding out the fastest Speed Trap speed for each driver and storing that output somewhere. This is how I do it.

Simple — just run through the data and pick the fastest speeds
Find the odd one out!

Immediately, we notice an anomaly — Yuki Tsunoda has a very low top speed : half that of the next lowest. A quick glance through the qualifying events will inform you that he had an issue — no time was set. This should not be used for any comparisons — always important to understand context.

Now , let’s quickly plot the top speeds — I am adding the teams here as this will add a bit more “context”.

There you have it! Top speeds galore!

Insight #1 : No more rocket ship

In a complete opposite to last year, McLaren are the slowest team in qualifying. This is kind of surprising as they were not the team with the worst porpoising. One big reason would be less development on the car compared to the competition — their brakes issue plagued them throughout preseason and Bahrain GP.

A bit of a positive spin on this would be that — despite McLaren having the lowest top speeds, they did manage to go into Q2 — so there is some potential there, with further developments down the road.

This is not ideal for a team aiming to be in contention for the third spot — but as Ricciardo put it, it was better than Bahrain.

Insight #2 : Aston Martin and their struggles with Porpoising

Aston Martin were one of the teams who really struggled with porpoising issues. Many news outlets reported the 0.75 sec/ lap performance price they were paying (by increasing ride height) to offset the porpoising issue.

This combined with their top speed being at the low end looks like this is going to be a difficult season for them.

Insight #3 : Hamilton Misses Q2

For the first time since 2009, Hamilton has failed to reach the Q2 — a significant difference in terms of top speed and lap time compared to George Russell. As he explained in his post-quali interview — his setup led to him losing confidence to push the car — “un-driveable” as he called it.

For now though, it looks to be a one off occurrence and we all know how well Lewis drives when he starts at the back of the grid. Gonna be an exciting race for sure.

Insight #4 : Ferrari “magic”

Ferrari have some ‘magic’ this year — they had the least difficulties with porpoising and throughout testing till now, they have shown commendable performance , leading to many wondering if their ‘magic’ engine is back.

The answer is surprising in some ways. Their top speed is just not in the same level as the red bull’s or even Alonso’s alpine. However as it was seen in Bahrain, their cornering performance and the engine acceleration has been at a whole another level — and the car feels supremely comfortable to both Leclerc and Sainz.

Is this the year for Ferrari? With the double retirement for Red Bull, it looks to be a strong yes.

Insight #5 : The new ‘Rocket-Ship’

Both Redbull cars showed very strong top speeds in the Speed Trap. Perez getting a well deserved pole , driving at the very limit of the car.

The first few turns of the race are going to be very interesting — a good straight start down into turns 1 and 2 should leave Verstappen eager to put behind the disappointment of P4 in qualifying.

Hang on a minute! Did you not see a pattern to those bars?

The Engine Manufacturers!

How could we have missed this! Well thankfully, all we need is to create a dict for the engine manufacturers and tweak a few lines of code.

Just a dict and a single line of code added.

Now quickly! Let’s plot this!

Should this be given as a homework next time?
What’s with all the red at the bottom?

Bonus Insight : Something’s wrong with those Merc Engines

It clearly looks like the Mercedes power train has been struggling. Sure, the individual teams have their own troubles : McLaren with their Brakes , Aston Martin with their porpoising , but still there is something worrying if the average top speed of their engines is at such a disadvantage compared to their competition — Even Renault are putting up a better show here.

How much is this dependent on the new E10 fuel is not yet known.

There’s also the matter of peak performance vs reliability — so may be we will need to wait and watch this space.

Part 3 : Final Thoughts

Thanks for reading through this article and do share your feedback!

Next, I am planning on going through certain individual quali laps analyses — this is surely going to be interesting so watch this space!

--

--

Rajaah Dhananjey

Data Analyst. Fascinated towards data and insightful analytics