Skip to main content
Race pace analysis is a common task in F1 data science. The analysis examines lap times over a long stint. The results show which driver is faster and how well each driver manages the tires. Race pace comparison box plot

Loading the Data

This example uses the 2024 Abu Dhabi Grand Prix. Use the polars lib for faster filtering.

Cleaning the Data

In a race, lap times can be skewed by:
  • Safety Car periods (very slow laps)
  • Pit stops (very slow laps)
  • Lap 1 (standing start)
Filter these laps out to get a “true” race pace.

Comparing Drivers

Compare the pace of the top two finishers.

Interpreting the Results

  • Median (line in the box): Represents the typical race pace.
  • Box size (IQR): Represents consistency. A smaller box means the driver was more consistent.
  • Whiskers/Outliers: Show variance caused by traffic or minor errors.

Visualizing Pace Over the Race

Plot lap times against lap numbers to see how the pace evolved (tire degradation).

Conclusion

Follow this workflow to:
  1. Load high-quality timing data.
  2. Clean it to remove anomalies.
  3. Compare drivers using statistical distributions.
  4. Visualize performance trends across the entire race.
Last modified on September 3, 2026