Skip to main content
These examples demonstrate how to analyze championship standings, season-long performance, and track driver/team positions throughout the season.

Results Tracker

Create a heatmap showing points scored by each driver at each race.

What This Example Shows

  • Using the Ergast API for historical data
  • Combining race and sprint results
  • Reshaping data with pandas pivot tables
  • Creating interactive heatmaps with Plotly
  • Handling sprint race weekends

Expected Output

An interactive heatmap where:
  • Rows: Drivers (ordered by championship position)
  • Columns: Races (in chronological order)
  • Cell color: Darker blue = more points
  • Cell value: Points scored at that race
  • Hover: Shows driver, race, and points

Understanding the Data

  • DNF/DNS: Shows as 0 points
  • Sprint weekends: Points combined from sprint and race
  • Driver ordering: Top of chart = championship leader

Season Summary

Create an interactive dashboard showing season performance with total points.

What This Example Shows

  • Loading full season data efficiently
  • Creating multi-panel Plotly dashboards
  • Handling different sprint race formats by year
  • Adding custom hover information
  • Combining per-race and total points views

Expected Output

An interactive dashboard with two heatmaps:
  1. Left panel: Points scored at each race
  2. Right panel: Total championship points
Features:
  • Hover shows driver, race, points, and position
  • Color intensity indicates points scored
  • Drivers ordered by total points (bottom to top)

Sprint Race Formats by Year

Championship Calculator

Calculate which drivers can still mathematically win the championship.

What This Example Shows

  • Using Ergast API for current standings
  • Calculating remaining points available
  • Accounting for sprint vs conventional races
  • Mathematical championship possibility analysis

Expected Output

A text output listing each driver with:
  • Current championship position
  • Current points total
  • Theoretical maximum points (if they win everything)
  • Whether they can mathematically win

Example Output

Points System

Current F1 points:
  • Race: 25, 18, 15, 12, 10, 8, 6, 4, 2, 1 (top 10)
  • Sprint: 8, 7, 6, 5, 4, 3, 2, 1 (top 8)
  • Fastest lap: +1 (if finishing in top 10)

Working with Ergast API

The Ergast API provides historical F1 data:

Available Methods

Ergast vs FastF1

Use Ergast when:
  • You need historical championship data
  • You want quick access to results without loading full sessions
  • You’re doing multi-season analysis
Use FastF1 when:
  • You need telemetry data
  • You want lap-by-lap details
  • You need timing data
  • You’re analyzing recent races (2018+)

Performance Tips

Loading Season Data

Caching

The Ergast API uses historical data and may have a delay of a few days after each race. For the most recent race, use FastF1’s session loading instead.