(Jun-17-2023, 02:19 PM)deanhystad Wrote: 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.
to be frank i am really new to this kind of stuff and i am using chatgpt/bard to execute the ideas i have in mind. i also do not get the concept of dataframes (the way they work) so i will try to get more informations on these matters and then i will try to update my code.
after few attempts and after making the changes you told me to make, i get this new error message:
Error:Traceback (most recent call last):
File "<tmp 11>", line 36, in <module>
race_data.load()
AttributeError: 'Weekend' object has no attribute 'load'
when i replace it with:laps=race_data.load_laps()
i get the following error message
Error:Traceback (most recent call last):
File "<tmp 12>", line 47, in <module>
laps = race_data.load_laps()
File "c:\users\windownet\appdata\local\programs\python\python311\Lib\site-packages\fastf1\core.py", line 1234, in load_laps
if any((laps, telemetry, weather, messages)):
File "c:\users\windownet\appdata\local\programs\python\python311\Lib\site-packages\fastf1\core.py", line 1311, in load_telemetry
result['New'] = False
TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given
by the way i checked and i found that i have the latest version of the package. the abnormalitites are certainly due to the fact that chatgpt uses an older version of the package and since i told it to fix the code before i came to the forum it appears that it worked with some older versionthanks in advance for taking time to help me.
buran write Jun-20-2023, 04:51 PM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.