Jun-17-2023, 02:19 PM
I am not seeing the error you describe. I get a TypeError when getting the session. The error cleared up when I changed line 28 to:
What version of fastf1 are you using? Almost none of your code is correct for the most recent version (3.0.4). Looking at the release notes it looks like you are using something pre-3.0. I suggest you get the newest version.
race_data = fastf1.get_session(2023, 1, "Race")After you get a session, you need to load the session data. This loads the data into DataFrames, so there is no reason to create them yourself.
race_data = fastf1.get_session(2023, 1, "Race") race_data.load() # Load the lap data df = pd.DataFrame(race_data.laps[["Time", "Compound"]])race_data.laps is a dataframe of lap data. df is the same data, but only for two columns (Time and Compound).
What version of fastf1 are you using? Almost none of your code is correct for the most recent version (3.0.4). Looking at the release notes it looks like you are using something pre-3.0. I suggest you get the newest version.