F1 Drivers' Championship 2021 (feat. Plotly)
Table of Contents
Summary
The goal of this article is to explore the 2021 Formula One World Drivers' Championship (WDC) using Plotly.py . 2021’s WDC involved 20 countries, 22 Grands Prix (GPs) and 21 drivers. Round 1 took place in Bahrain in March 26-28, Round 22 ended the season in Abu Dhabi in December 10-12. It was one of the most competitive seasons in years, pitting Mercedes' Hamilton and Red Bull’s Verstappen against each other in a closely contested competition from start to finish. The focus will be on a dataset of scored points by GP (sourced from FIA Results & Statistics ). The code for this analysis can be found on GitHub .
F1’s Points Scoring System (2021)
Since this analysis is based on scored points, it makes sense to have a basic understanding of how points are scored in F1. The points scoring system in F1 has suffered many changes throughout the years ; the following was the system in place in 20211:
- Finishing a race anywhere from 1st to 10nth place awards points as per Table 1.
- Racing the fastest lap and also finishing in the top 10 (aka “in the points”) awards 1 point.
- Finishing anywhere from 1st to 3rd in any of the three sprint qualifying races awards 3, 2, and 1 points respectively2.
Table 1. Points Earned by the Top 10 Drivers
Place | Points | % of first place | % of previous place (n-1) |
---|---|---|---|
1 | 25 | 100% | - |
2 | 18 | 72% | 72% |
3 | 15 | 60% | 83% |
4 | 12 | 48% | 80% |
5 | 10 | 40% | 83% |
6 | 8 | 32% | 80% |
7 | 6 | 24% | 75% |
8 | 4 | 16% | 67% |
9 | 2 | 8% | 50% |
10 | 1 | 4% | 50% |
Analysis
Heatmap: Individual Driver–GP Performances
The raw dataset consists of scored points for 21 drivers in 22 GPs, for a total of 462 observations. We begin by using a heatmap to get a first impression of what’s going on. Heatmaps offer a great way to quickly scan highs and lows in numeric data (see Figure 1).
Note that the axes of Figure 1 are ordered. The y-axis is ordered by the final score in the competition (from first to last), and the x-axis is ordered by date of occurrence of each Grand Prix. Figure 1 effectively constitutes a series of sequential snapshots of GP results by driver, from start to finish.
Figure 1. Heatmap
Figure 1 is quite telling. We can quickly spot the winner of each GP (i.e., Position 1, P1) by finding the lightest square in its corresponding column. This reveals Verstappen won 10/22 GPs (~45%), and Hamilton won 8/22 (~36%)—for a combined 18/22 (~81%) first-place wins between the two.
By analyzing sharply contrasting cells, we can spot potential anomalies or points of interest—e.g., Verstappen’s four darkish squares, explained by: crashing into a wall in Azerbaijan , crashing into another wall after making contact with Hamilton in Silverstone , racing with a battered car after early-race collisions in Hungaroring , and crashing into Hamilton in spectacular fashion after pitting in Monza . As for Hamilton, he made a costly mistake selecting the wrong brake mode on lap 50 in Azerbaijan, ending up with his worst finish in over twelve years, and earning zero points in the process.
Interestingly, these eventful GPs tend to shake up the status quo and give opportunities to other drivers outside of the Verstappen–Hamilton power duo. Such was the case in Azerbaijan, where Perez got his only win of the season, and Vettel had his best outing and only podium of 2021. Rain and collisions in Hungaroring saw Ocon prevail to get his first and only win so far in his F1 career. And the Verstappen–Hamilton crash in Monza gave way to a McLaren-dominated GP, with Ricciardo P1 and Norris P2; also their best outings of the season.
Lines & Markers: Championship Standings Over Time
Although the heatmap presents a great starting point to spot consecutive wins, potential anomalies, and get an intuition for drivers' performances in individual GPs, it is quite limited in that it doesn’t track the evolution of Championship standings over time. For that, we introduce Figure 2, which is computed as a running sum by column after each GP.
Figure 2. Cumulative Points – All Drivers (Top 10 Preselection)
Figure 2 is a scatterplot
with lines and markers. Note that by default, only the top 10 drivers are selected, although the remaining 11 can still be turned on simply by clicking on their names in the legend. This is a fantastic feature of Plotly to highlight a desired initial state of the figure. This can be done by passing visible='legendonly'
to fig.add_trace(go.Scatter(...))
for the series we want off at the start.
I would say the most salient feature of Figure 2 is the close fight between Verstappen and Hamilton, from the very first GP in Bahrain up until the final moment in the Abu Dhabi GP. The largest score gap between them throughout the entire season was just 32 points—after Verstappen won the Austrian GP.
After the Saudi Arabian GP both drivers came into the final race in Abu Dhabi with a climactic tie of 369.5 points (Verstappen was technically ahead by virtue of having won 9 GPs vs Hamilton’s 8). Verstappen ended up winning the Abu Dhabi GP and his first WDC trophy along with it; though not without plenty of controversy . Hamilton took second place, barely 8 points behind.
Figure 2 reveals much more clearly how far ahead of the pack these two drivers went as the season developed. However, there were still plenty of other interesting battles going on in the grid. For example, Bottas and Perez fighting it out for 3rd place; Sainz, Norris and Leclerc for 5th; Alonso and Ocon for 10th, etc.
Appendix: Drivers in Positions 11 and Below3
Figure 3. Drivers in Positions 11 and Below
Notes
-
Sprint qualifying races were added by the FIA in agreement with all 10 teams in 2021, intended as a way for F1 to “seek new ways to engage with its fans and enlarge the spectacle of a race weekend”. Three sprint qualifying races were added, held at the British, Italian, and São Paulo Grands Prix. ↩︎
-
Figure 3 is mostly a convenience plot, since it can be reconstructed by applying the appropriate filters to Figure 2. But just because you can, it doesn’t mean you should, having a single figure for everything can make for bad UX. ↩︎