Skip to content

Unable to Accurately Calculate Finishing Position by Cumulative Lap Time #354

Answered by theOehrly
andrewestes41 asked this question in Q&A
Discussion options

You must be logged in to vote
import pandas as pd

import fastf1 as ff1
from fastf1 import plotting

plotting.setup_mpl()



saudi_arabia_race_21 = ff1.get_session(2021, 21, 'R')
saudi_arabia_race_21.load()
saudi_arabia_race_21_laps = saudi_arabia_race_21.laps
saudi_arabia_race_21_results = saudi_arabia_race_21.results

# %% making data into date-time
saudi_arabia_race_21_results.rename(columns={'Abbreviation': 'Driver'}, inplace=True)
testMerge = pd.merge(saudi_arabia_race_21_laps,
                     saudi_arabia_race_21_results[['Driver', 'GridPosition', 'Position', 'Points']], on='Driver',
                     how='left')


### my code ###
testMerge['TotalTime'] = testMerge['Time'] - saudi_arabia_race_21.session_…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@andrewestes41
Comment options

@theOehrly
Comment options

@andrewestes41
Comment options

@theOehrly
Comment options

Answer selected by andrewestes41
@andrewestes41
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants