Python Forum
problem with a formula 1 kind of homework
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with a formula 1 kind of homework
#2
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:
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.
Reply


Messages In This Thread
RE: problem with a formula 1 kind of homework - by deanhystad - Jun-17-2023, 02:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Bakery Problem.. Can you Help My Homework Cemvrs 1 2,432 Jan-14-2022, 05:47 PM
Last Post: Yoriz
  Can someone find out what kind of histogram is it? J_tin 1 1,859 Apr-26-2020, 05:23 PM
Last Post: buran
  Need help with a homework problem on logical operators voodoo 3 4,668 Jun-28-2019, 03:45 PM
Last Post: jefsummers
  Homework Problem csascott 1 2,328 Oct-27-2018, 04:44 AM
Last Post: scidam
  Homework Problem Travisbulls34 1 3,009 Sep-11-2018, 04:04 PM
Last Post: ichabod801
  Help with homework problem - iterating a function midnitetots12 4 3,596 Feb-21-2018, 10:51 PM
Last Post: nilamo
  Problem with a homework Samuelcu 2 2,898 Feb-03-2018, 01:39 PM
Last Post: Samuelcu
  Homework problem Dem_Prorammer 1 3,882 May-20-2017, 07:49 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020