Skip to main content
The Laps and Lap classes provide access to lap timing data with filtering and telemetry access.

Laps

DataFrame-like object for accessing lap timing data of multiple laps. Constructor:
session
Session | None
default:"None"
Instance of Session class (required for full functionality)
Available Columns:
  • Time (timedelta64[ns]): Time when the lap was completed
  • Driver (str): Driver three-letter abbreviation
  • DriverNumber (str): Driver number
  • LapTime (timedelta64[ns]): Lap time duration
  • LapNumber (float64): Lap number
  • Stint (float64): Stint number
  • PitOutTime (timedelta64[ns]): Time when car exited pit lane
  • PitInTime (timedelta64[ns]): Time when car entered pit lane
  • Sector1Time (timedelta64[ns]): Sector 1 time
  • Sector2Time (timedelta64[ns]): Sector 2 time
  • Sector3Time (timedelta64[ns]): Sector 3 time
  • Sector1SessionTime (timedelta64[ns]): Session time at sector 1
  • Sector2SessionTime (timedelta64[ns]): Session time at sector 2
  • Sector3SessionTime (timedelta64[ns]): Session time at sector 3
  • SpeedI1 (float64): Speed trap at intermediate 1 (km/h)
  • SpeedI2 (float64): Speed trap at intermediate 2 (km/h)
  • SpeedFL (float64): Speed trap at finish line (km/h)
  • SpeedST (float64): Speed trap at speed trap (km/h)
  • IsPersonalBest (bool): Whether this lap is the driver’s personal best
  • Compound (str): Tyre compound (‘SOFT’, ‘MEDIUM’, ‘HARD’, ‘INTERMEDIATE’, ‘WET’)
  • TyreLife (float64): Laps completed on this set of tyres
  • FreshTyre (bool): Whether tyres were new when fitted
  • Team (str): Team name
  • LapStartTime (timedelta64[ns]): Time when the lap started
  • LapStartDate (datetime64[ns]): Date when the lap started
  • TrackStatus (str): Track status flags during the lap
  • Position (float64): Position at the end of this lap
  • Deleted (bool): Whether the lap time was deleted
  • DeletedReason (str): Reason for deletion
  • FastF1Generated (bool): Whether this lap was generated by FastF1
  • IsAccurate (bool): Whether the lap passed accuracy validation

Filtering Methods

pick_drivers()

Return all laps of the specified driver(s).
identifiers
int | str | Iterable[int | str]
required
Driver abbreviation(s) or driver number(s) - can be mixed
return
Laps
Filtered Laps object
Example:
# Single driver
ver_laps = laps.pick_drivers('VER')
ham_laps = laps.pick_drivers(44)

# Multiple drivers
top_3_laps = laps.pick_drivers(['VER', 'HAM', 'LEC'])
mixed = laps.pick_drivers([1, 'HAM', 44])

pick_teams()

Return all laps of the specified team(s).
names
str | Iterable[str]
required
Team name(s)
return
Laps
Filtered Laps object
Example:
# Single team
rbr_laps = laps.pick_teams('Red Bull Racing')

# Multiple teams
top_teams = laps.pick_teams(['Red Bull Racing', 'Ferrari', 'Mercedes'])

pick_laps()

Return all laps matching specific lap number(s).
lap_numbers
int | Iterable[int]
required
Lap number or iterable of lap numbers
return
Laps
Filtered Laps object
Example:
# Single lap
lap_1 = laps.pick_laps(1)

# Range of laps
laps_10_to_20 = laps.pick_laps(range(10, 21))

# Specific laps
specific = laps.pick_laps([1, 5, 10, 20])

pick_fastest()

Return the lap with the fastest lap time.
only_by_time
bool
default:"False"
If False, only return laps marked as personal best. If True, ignore personal best flag and return the absolute fastest lap.
return
Lap | None
The fastest Lap object, or None if no valid lap exists
Example:
# Fastest personal best lap
fastest = laps.pick_fastest()

# Absolute fastest lap (even if deleted)
fastest_any = laps.pick_fastest(only_by_time=True)

pick_quicklaps()

Return all laps faster than a threshold (default: 107% of fastest lap).
threshold
float | None
default:"None"
Custom threshold coefficient (e.g., 1.05 for 105%). Defaults to 1.07 (107%).
return
Laps
Filtered Laps object
Example:
# Use default 107% rule
quick_laps = laps.pick_quicklaps()

# Custom 105% threshold
quick_laps = laps.pick_quicklaps(threshold=1.05)

pick_compounds()

Return all laps done on specific tyre compound(s).
compounds
str | Iterable[str]
required
Compound name(s): ‘SOFT’, ‘MEDIUM’, ‘HARD’, ‘INTERMEDIATE’, ‘WET’, ‘UNKNOWN’, ‘TEST_UNKNOWN’
return
Laps
Filtered Laps object
Example:
# Single compound
soft_laps = laps.pick_compounds('SOFT')

# Multiple compounds (all slicks)
slick_laps = laps.pick_compounds(['SOFT', 'MEDIUM', 'HARD'])

pick_track_status()

Return all laps set under a specific track status.
status
str
required
The track status as a string (e.g., ‘1’ for green flag, ‘2’ for yellow flag, ‘4’ for safety car)
how
str
default:"'equals'"
Matching method: ‘equals’, ‘contains’, ‘excludes’, ‘any’, ‘none’
return
Laps
Filtered Laps object
Example:
# Green flag laps only
green_laps = laps.pick_track_status('1', how='equals')

# Any lap with yellow flag
yellow_laps = laps.pick_track_status('2', how='contains')

pick_wo_box()

Return all laps which are NOT in-laps or out-laps.
return
Laps
Filtered Laps object

pick_box_laps()

Return in-laps, out-laps, or both.
which
str
default:"'both'"
One of ‘in’, ‘out’, or ‘both’
return
Laps
Filtered Laps object

pick_accurate()

Return all laps which pass accuracy validation.
return
Laps
Filtered Laps object

pick_not_deleted()

Return all laps whose lap times are NOT deleted.
return
Laps
Filtered Laps object

Telemetry Methods

get_telemetry()

Get telemetry data for all laps in this Laps object.
frequency
int | Literal['original'] | None
default:"None"
Optional frequency to override the default. Either ‘original’ or an integer for frequency in Hz.
return
Telemetry
Telemetry object with merged car and position data
Laps must contain data from only one driver.

get_car_data()

Get car data (Speed, RPM, Throttle, etc.) for all laps.
return
Telemetry
Telemetry object with car data only

get_pos_data()

Get position data (X, Y, Z coordinates) for all laps.
return
Telemetry
Telemetry object with position data only

get_weather_data()

Return weather data for each lap.
return
pd.DataFrame
DataFrame with weather data for each lap

Other Methods

split_qualifying_sessions()

Split laps into Q1, Q2, and Q3 sessions.
return
list[Optional[Laps]]
List containing three Laps objects for Q1, Q2, and Q3. Returns None for cancelled sessions.
Example:
quali = session.laps
q1, q2, q3 = quali.split_qualifying_sessions()

if q3 is not None:
    print(f"Q3 fastest: {q3.pick_fastest()['LapTime']}")

iterlaps()

Iterator for iterating over all laps.
require
Iterable | None
default:"None"
List of required column names. Only yields laps where all required values are non-null.
Example:
for index, lap in laps.iterlaps(require=['LapTime', 'Sector1Time']):
    print(f"Lap {lap['LapNumber']}: {lap['LapTime']}")

Lap

Single lap object (returned when slicing Laps to a single row). Properties: All columns from Laps are accessible as properties on a Lap object. Methods:

get_telemetry()

Get telemetry data for this lap.
frequency
int | Literal['original'] | None
default:"None"
Optional frequency override
return
Telemetry
Telemetry object for this lap

get_car_data()

Get car data for this lap.
return
Telemetry
Telemetry object with car data

get_pos_data()

Get position data for this lap.
return
Telemetry
Telemetry object with position data

get_weather_data()

Get weather data for this lap.
return
pd.Series
Weather data for this lap

Complete Usage Example

import fastf1
import matplotlib.pyplot as plt

# Load session
session = fastf1.get_session(2023, 'Monaco', 'Race')
session.load()

# Get all laps
laps = session.laps

# Filter laps
ver_laps = laps.pick_drivers('VER').pick_quicklaps()
print(f"Verstappen quick laps: {len(ver_laps)}")

# Get fastest lap
fastest = ver_laps.pick_fastest()
print(f"Fastest lap: {fastest['LapTime']}")
print(f"Compound: {fastest['Compound']}")
print(f"Tyre life: {fastest['TyreLife']} laps")

# Get telemetry for fastest lap
tel = fastest.get_telemetry()

# Plot speed trace
fig, ax = plt.subplots()
ax.plot(tel['Distance'], tel['Speed'])
ax.set_xlabel('Distance (m)')
ax.set_ylabel('Speed (km/h)')
ax.set_title('VER Fastest Lap - Speed Trace')
plt.show()

# Compare two drivers
ver_fastest = laps.pick_drivers('VER').pick_fastest()
ham_fastest = laps.pick_drivers('HAM').pick_fastest()

ver_tel = ver_fastest.get_telemetry()
ham_tel = ham_fastest.get_telemetry()

fig, ax = plt.subplots()
ax.plot(ver_tel['Distance'], ver_tel['Speed'], label='VER')
ax.plot(ham_tel['Distance'], ham_tel['Speed'], label='HAM')
ax.set_xlabel('Distance (m)')
ax.set_ylabel('Speed (km/h)')
ax.legend()
plt.show()

Build docs developers (and LLMs) love