Visualizing Formula 1 Race Strategies in Python using Fastf1, Pandas and Matplotlib

Jasper
Towards Formula 1 Analysis
5 min readJan 29, 2022

--

Photo by Felix Mittermeier on Unsplash

There is no single Formula 1 race in which strategy does not play a significant role. Getting a high-level overview of the different strategic choices that were made during a race can give you interesting insights! This tutorial will show you how you can visualize the pitstop- and tyre strategies of a race, like in the following figure:

Doing this will learn you how reshape the raw data to the format we need it to be, and will show you how to visualize this using horizontal stacked bar charts. Great skills to achieve!

Are you completely new to doing data analysis in Python? No worries, I’ve got you covered. Check out this tutorial first:

If you’re all set, let’s dive right in!

2021 Russian GP

--

--

Jasper
Towards Formula 1 Analysis

Writing tutorials about Data Analysis & Visualization through Formula 1 Examples