theoehrly / fast-f1 Goto Github PK
View Code? Open in Web Editor NEWFastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
Home Page: https://docs.fastf1.dev
License: MIT License
FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
Home Page: https://docs.fastf1.dev
License: MIT License
Hello,
sorry for being a complete beginner to programming. But I'm not able to really do anything. just tried the example provided:
"import fastf1 as ff1
from fastf1 import plotting
from matplotlib import pyplot as plt
plotting.setup_mpl()
ff1.Cache.enable_cache('path/to/folder/for/cache') # optional but recommended
race = ff1.get_session(2020, 'Turkish Grand Prix', 'R')
laps = race.load_laps()
lec = laps.pick_driver('LEC')
ham = laps.pick_driver('HAM')"
So I'm getting an error code of:
"File "C:****\F1\F1FastTest.py", line 12, in plotting.setup_mpl()
AttributeError: module 'fastf1.plotting' has no attribute 'setup_mpl'"
and if I comment it out it gets stuck at:
"File "C:**\anaconda3\envs\spyder\lib\site-packages\requests_cache\backends\storage\dbdict.py", line 74, in connection
con = sqlite.connect(self.filename)
OperationalError: unable to open database file"
I tried several Python versions but didn't seem to fix the issue. Is it because ther eis a live session going on? Or am I just too stupid to operate this :)
Peter
How can we check the tyre compound and age when returning data of fastest lap of each driver?
For 3 times every 3 minutes, when I am recording fp1 data, cmd tells me 'received no data for more than 60 seconds, exiting'. I don't know, my connection seems stable, but maybe this is the problem and I am wrong... Anyway the file it saved is not txt but it's a file that windows doesn't recognize. Is it normal? And HOW to downgrade to 2.1.4 if I get the same problem in FP2????
For FP1 of the 2021 Emilia Romagna Grand Prix the load_laps function in core.py errors out with a UnboundLocalError on line 1192.
Line 1192 in 8da6cbb
I've traced it back to the fact that no drivers are getting any data back from the timing_app_data api call. The useful
data frame is empty, so when the for each driver loop occurs the length of d2 is always 0, meaning the loop ends without df ever having being initialized as a variable.
Lines 1168 to 1190 in 8da6cbb
Hello,
I'm trying to load the data for todays qualifying and the Ergast API lookup fails (obviously not fastf1's fault).
How will getting data for this qualifying and the sprint race qualifying work if Ergast doesn't update their API?
Thank you.
Hi,
I've the ZIP file downloaded by Ax6 github before it disappeared.
It should be v.1.5.11 with some modification made after this year winter testing.
It seems to be better commented and have some differences with your code.
Fast-F1-master-v1.5.11.zip
So I downloaded the live data from qualifying yesterday and trying to load it into python I'm getting this error. Is it really supposed to download api data when I have the live-data downloaded? Or is it for meta data?
"runfile('C:/Users/peter/OneDrive/Dokument/F1/Live.py', wdir='C:/Users/peter/OneDrive/Dokument/F1')
core INFO Loading Bahrain Grand Prix - Qualifying
api INFO No cached data found. Downloading...
data INFO Loading live timing data. This may take a bit.
Traceback (most recent call last):
File "C:\Users\peter\OneDrive\Dokument\F1\Live.py", line 15, in
quali.load_laps(with_telemetry=True, livedata=livedata)
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\core.py", line 1141, in load_laps
data, _ = api.timing_data(self.api_path, livedata=livedata)
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\api.py", line 178, in cached_api_request
data = func(api_path, response=response, livedata=livedata)
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\api.py", line 290, in timing_data
if livedata is not None and livedata.has('TimingData'):
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 215, in has
self.load()
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 74, in load
self._load_single_file(fname)
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 112, in _load_single_file
self._parse_session_data(msg)
File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 139, in _parse_session_data
if isinstance(msg['StatusSeries'], dict):
KeyError: 'StatusSeries'"
Loads data for Turkish GP properly when I put in 'Turkey' for the GP name, but loads data for British GP when I put in 'TURKEY' in uppercase.
Hi, I am having problems with the FP2 of the Spanish GP. When trying to resample, the script crashes.
This is the error
WARNING:root:Ergast lookup failed INFO:root:Loading Spanish Grand Prix Practice 2 INFO:root:Getting summary... INFO:root:Formatting summary... INFO:root:Getting telemetry data... INFO:root:Fetching car data INFO:root:Parsing car data INFO:root:Getting position data... INFO:root:Fetching position INFO:root:Parsing position INFO:root:Resampling telemetry... Traceback (most recent call last): File "main2piloti-2.py", line 22, in <module> giri = sess.load_laps() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\utils.py", line 118, in decorator return func(*args, **kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 340, in load_laps telemetry, lap_start_date = self._load_telemetry() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 448, in _load_telemetry self._augment_position() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 600, in _augment_position driver_ahead = self._make_trajectory(lap) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 719, in _make_trajectory dmap[:, index] = fix_suzuka(projection_index.copy(), reference_s) ValueError: could not broadcast input array from shape (33114) into shape (64013)
Hi, with Fast-F1 is it possible to create an analysis of the Microsectors? Let me explain better, a map of the circuit where the driver who made the best micro-sector is highlighted, for example in Q3. I don't know if I've made myself clear
Only a minor issue, but the driver data in the API uses "Alpine F1 Team", the docs for plotting.TEAM_COLORS
and plotting.TEAM_TRANSLATE
say "Alpine F1 Team", but for me in 2.1.6 those actual dictionaries use "Alpine".
import fastf1 as ff1
from fastf1 import plotting
from matplotlib import pyplot as plt
from fastf1 import utils
plotting.setup_mpl()
quali = ff1.get_session(2021, 'Bahrain', 'Q')
laps = quali.load_laps()
lec = laps.pick_driver('LEC').pick_fastest()
ham = laps.pick_driver('HAM').pick_fastest()
delta_time, ref_tel, compare_tel = utils.delta_time(ham, lec)
fig, ax = plt.subplots()
ax.plot(ref_tel['Distance'], ref_tel['Speed'],
color=plotting.TEAM_COLORS[ham['Team']])
ax.plot(compare_tel['Distance'], compare_tel['Speed'],
color=plotting.TEAM_COLORS[lec['Team']])
When executed returns this
core INFO Loading Bahrain Grand Prix - Qualifying
api INFO No cached data found. Downloading...
api INFO Fetching timing data...
api INFO Parsing timing data...
api INFO Data has been written to cache!
api INFO No cached data found. Downloading...
api INFO Fetching timing app data...
api INFO Data has been written to cache!
core INFO Processing timing data...
api INFO No cached data found. Downloading...
api INFO Fetching session status data...
api INFO Data has been written to cache!
api INFO No cached data found. Downloading...
api INFO Fetching track status data...
api INFO Data has been written to cache!
core INFO Loaded data for 20 drivers: ['33', '44', '10', '77', '11', '55', '7', '31', '18', '3', '16', '99', '22', '5', '14', '4', '63', '47', '9', '6']
Traceback (most recent call last):
File "/Users/rahul/testing.py", line 15, in
delta_time, ref_tel, compare_tel = utils.delta_time(ham, lec)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/fastf1/utils.py", line 68, in delta_time
ref = reference_lap.get_car_data(interpolate_edges=True).add_distance()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/fastf1/core.py", line 1810, in get_car_data
car_data = self.session.car_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '44'
Dunno if I'm trying to do something I shouldn't; very new to this (and to Python). Noticed official timing app seems to be getting the telemetry data once again so I tried to see if telemetry would work again...
import fastf1 as ff1
ff1.Cache.enable_cache('/a/local/directory/i/have') # pointed to a local dir
race = ff1.get_session(2021, 1, 'R')
lap = race.load_laps(True,) # to get telemetry with this
ham = lap.pick_driver('HAM')
# test code
tlm = get_telemetry()
I got the following error:
Traceback (most recent call last):
File "<ipython-input-6-182498178710>", line 1, in <module>
tlm = ham.get_telemetry()
File "\site-packages\fastf1\core.py", line 1524, in get_telemetry
pos_data = self.get_pos_data(pad=1, pad_side='both')
File "\site-packages\fastf1\core.py", line 1573, in get_pos_data
pos_data = self.session.pos_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
File "\lib\site-packages\pandas\core\generic.py", line 1785, in __hash__
raise TypeError(
TypeError: 'Lap' objects are mutable, thus they cannot be hashed
I wonder if there's an issue in the get_pos_data()
since it seems to call ['DriverNumber']
instead of the actual drv_num
. Compare the following lines
from get_pos_data
from get_car_data
/usr/local/lib/python3.8/dist-packages/fastf1/core.py:1353: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only
drv_car = Telemetry(car_data[drv].drop('Time', 1), session=self, driver=drv)
/usr/local/lib/python3.8/dist-packages/fastf1/core.py:1354: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only
drv_pos = Telemetry(pos_data[drv].drop('Time', 1), session=self, driver=drv)
python -m fastf1.livetiming save saved_data.txt
^
SyntaxError: invalid syntax
Does anybody know what the issue is here?
Hello,
I hope my words are not taken badly, but I would like to suggest to put a sort of login procedure at the beginning of the connection which will allow only those who have a subscription to the f1 account to access the data. The F1 app is a paying app and by using this script you are allowing anyone, even those who do not have a subscription, to access the data. This was probably discovered and now F1 is removing the files on purpose, since it is removing just the data files this script basically use. So, if I may suggest, I would reconsider the policy of this app because the more you push for letting the data free of paying, the more F1 will make it difficult to get them and since the rest of the public are paying to see the numbers I personally believe they are right.
Regards
P
This is what I get when I execute the code:
core WARNING Ergast API lookup failed. The session is very recent and not yet available or does not exist.
core INFO Loading laps for Italian Grand Prix - Qualifying [v2.1.6]
api INFO No cached data found for timing_data. Loading data...
api INFO Fetching timing data...
Traceback (most recent call last):
File "plot_qualifying_results.py", line 25, in <module>
laps = quali.load_laps()
File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\core.py", line 1148, in load_laps
data, _ = api.timing_data(self.api_path, livedata=livedata)
File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\api.py", line 178, in cached_api_request
data = func(api_path, response=response, livedata=livedata)
File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\api.py", line 296, in timing_data
raise SessionNotAvailableError("No data for this session! Are you sure this session wasn't cancelled?")
fastf1.api.SessionNotAvailableError: No data for this session! Are you sure this session wasn't cancelled?
I was digging through the telemetry data and I was curious about the DRS integer values.
I was not able to find anything in the documentation. Here is an example from another thread it has already been plotted:
Some drives have clean data sets of {0,1}, while other have a range of values from 0 to ~14.
Is there any insight to be had with the range of values or just an artifact of the data that is being pulled?
Thanks!
Having an issue pulling the car data:
race = ff1.get_session(2021, 9, 'R')
laps = race.load_laps()
ver = laps.pick_driver('VER').pick_fastest()
ver_car = ver.get_car_data()
As result I get the output below
Traceback (most recent call last):
File "graphing.py", line 29, in <module>
ver_car = ver.get_car_data()
File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1919, in get_car_data
car_data = self.session.car_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '33'
Same when trying to get telemetry data instead of only car data:
race = ff1.get_session(2021, 9, 'R')
laps = race.load_laps()
ver = laps.pick_driver('VER').pick_fastest()
ver_car = ver.get_telemetry()
As result I get the output below
Traceback (most recent call last):
File "graphing.py", line 29, in <module>
ver_car = ver.get_telemetry()
File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1891, in get_telemetry
pos_data = self.get_pos_data(pad=1, pad_side='both')
File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1933, in get_pos_data
pos_data = self.session.pos_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '33'
Is this also related to the DriverNumber != drv_num issue?
Is it possible to have a similar feature in Fast-F1 or another program that allows you to have a live telemetry graph (instead of that shit F1 graph in the app)?
I open this issue because I saw that now we need to register the live packages, so (non-programmer hypothesis) the work is halfway.
Thank you
Hello
When I try to load the laps with the with_telemetry=True
option, I get the following error
gp_3_quali = ff1.get_session(2021, 3, "Q")
gp_3_quali_laps = gp_3_quali.load_laps(with_telemetry=True)
Traceback (most recent call last):
File "<ipython-input-16-427ece08fcbb>", line 2, in <module>
gp_3_quali_laps = gp_3_quali.load_laps(with_telemetry=True)
File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\fastf1\core.py", line 1234, in load_laps
self.load_telemetry()
File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\fastf1\core.py", line 1314, in load_telemetry
drv_car['Date'] = drv_car['Date'].round('ms')
File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\pandas\core\series.py", line 2145, in round
result = com.values_from_object(self).round(decimals)
TypeError: an integer is required (got type str)
Hello!
I am having issues when I try to use the get_driver(str)
method. It's behaviour is very strange, since sometimes work but sometimes doesn't. (specially with the dnf attribute)
This is the error I get:
race_session =fastf1.get_session(2004,6,'R')
print(race_session.get_driver('MSC').dnf)
if info['Driver']['code'] == identifier:
KeyError: 'code'
However, with 2002 and 2003 sessions works correctly.
Is there any other way to know if a driver had a DNF?
Thanks
race = ff1.get_session('2021',gp = 'testing')
Traceback (most recent call last):
File "", line 1, in
File "/Users/rahul/Library/Python/3.9/lib/python/site-packages/fastf1/core.py", line 132, in get_session
pre_season_week, event = _get_testing_week_event(year, event)
File "/Users/rahul/Library/Python/3.9/lib/python/site-packages/fastf1/core.py", line 196, in _get_testing_week_event
raise InvalidSessionError
fastf1.core.InvalidSessionError: No matching session can be found
I get this error when I try to load data from this season's testing
Scrolling through the Twitter timeline I found this tweet about finding an API path that gives new information about the race pitch. Is this true?
Here's the tweet: https://twitter.com/RacingTelemetry/status/1426510505544400897?s=20
Hi, how can I make a Boxplot of the times with a type of rubber? I tried, but he tells me he doesn't accept timedelta
Also, is it possible to implement a function for the SpeedDelta?
Hi, is it possible to implement a system that, based on the GPS tracks, inserts labels in the X axis of the Distance with the number of the turn and the sectors?
I get the following error when trying to compare best Q laps of LEC and HAM. Other sessions work correctly:
core WARNING Ergast API lookup failed. The session is very recent and not yet available or does not exist.
core INFO Loading laps for Azerbaijan Grand Prix - Qualifying [v2.1.5]
api INFO Using cached data for timing_data
api INFO Using cached data for timing_app_data
core INFO Processing timing data...
api INFO Using cached data for session_status_data
api INFO Using cached data for track_status_data
api INFO Using cached data for car_data
api INFO Using cached data for position_data
core INFO Loaded data for 20 drivers: ['77', '31', '10', '4', '9', '63', '99', '6', '33', '44', '7', '47', '3', '55', '22', '14', '16', '5', '18', '11']
Traceback (most recent call last):
File "/home/andreak/src/Python/F1data/F1data_compare2pilots_speeds_bestLap.py", line 25, in
ax.plot(lec.telemetry['Distance'], lec.telemetry['Speed'],
File "/usr/lib/python3.9/functools.py", line 969, in get
val = self.func(instance)
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 1772, in telemetry
return self.get_telemetry()
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 1793, in get_telemetry
car_data = car_data.add_distance().add_relative_distance().add_driver_ahead()
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 797, in add_driver_ahead
drv_ahead, dist = self.calculate_driver_ahead()
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 889, in calculate_driver_ahead
drv_tel = self.session.car_data[drv].slice_by_lap(relevant_laps).add_distance() \
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 735, in add_distance
return self.join(pd.DataFrame({'Distance': self.integrate_distance()}), how='outer')
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 827, in integrate_distance
ds = self.calculate_differential_distance()
File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 809, in calculate_differential_distance
raise ValueError("Telemetry does not contain required channels 'Time' and 'Speed'.")
ValueError: Telemetry does not contain required channels 'Time' and 'Speed'.
I tried to follow the code snippet in the documentation but failed to get telemetry data so far.
import fastf1 as ff1
ff1.Cache.enable_cache('/home/kvuong/formula1/fastf1-cache') # optional but highly recommended
monza_quali = ff1.get_session(2019, 'Monza', 'Q')
vettel = monza_quali.get_driver('VET')
print(f"Pronto {vettel.name}?")
# Pronto Se🅱️astian?
from matplotlib import pyplot as plt
from fastf1 import plotting
plotting.setup_mpl()
laps = monza_quali.load_laps(with_telemetry=True)
Following is the output:
TypeError Traceback (most recent call last)
<ipython-input-18-ba43093f9722> in <module>
4 plotting.setup_mpl()
5
----> 6 laps = monza_quali.load_laps(with_telemetry=True)
7
8
~/anaconda3/lib/python3.8/site-packages/fastf1/core.py in load_laps(self, with_telemetry, livedata)
1251
1252 if with_telemetry:
-> 1253 self.load_telemetry(livedata=livedata)
1254
1255 # load weather data; this data is not crucial, just log a warning
~/anaconda3/lib/python3.8/site-packages/fastf1/core.py in load_telemetry(self, livedata)
1354 drv_pos = Telemetry(pos_data[drv].drop('Time', 1), session=self, driver=drv)
1355
-> 1356 drv_car['Date'] = drv_car['Date'].round('ms')
1357 drv_pos['Date'] = drv_pos['Date'].round('ms')
1358
~/anaconda3/lib/python3.8/site-packages/pandas/core/series.py in round(self, decimals, *args, **kwargs)
2143 Series.idxmin : Return index *label* of the first occurrence
2144 of minimum of values.
-> 2145
2146 Notes
2147 -----
TypeError: an integer is required (got type str)
I'm using fastf1-2.1.6
installed through pip, with Python 3.8.6 and matplotlib 3.2.2. Please advise!
Hi, having a look at the livetiming data I saw that data regarding the weather are also saved. Is it possible to implement a method that returns the weather conditions during the whole race for example?
All other cars are fine and give the correct hex colour, however alpine always seems to be classified as a none type object which causes problems later on. Anybody know of a fix to this?
Thanks
Hello, I found on the official F1 site that there is a link called http://api.formula1.com/v1/event-tracker . I am not much a developer and learned a little bit python in school so just posted if anyone finds it useful.
Hi! Is there any method to know when does a session end?
Especially for qualifying sessions, just wanted to know at what time of the session does the chequered flag appeared.
(it is to know if a driver crossed the line on time and by how much)
Thanks
I am not able to load session data for any Grand Prix, while I was able to do a couple of days ago successfully.
`import fastf1 as ff1
from fastf1 import plotting
from fastf1 import utils
import matplotlib.pyplot as plt
plotting.setup_mpl()
ff1.Cache.enable_cache('./cache')
session = ff1.get_session(2021, "Zandvoort", 'Q')`
I do not get any output for the request.
Several drivers had stints on inters at Spa FP1/FP2 and these do appear when running:
pd.DataFrame(session.load_laps(with_telemetry=True).pick_driver(driver))
However, they are missing when filtering accurate laps:
pd.DataFrame(session.load_laps(with_telemetry=True).pick_driver(driver).loc[all_laps['IsAccurate'] == True])
Hi, could you add some examples and more precise documentation on the livetiming module and how to extract the data, etc.?
Hi, I'm trying to see the data of Sainz' accident but there are no data and times for that lap. I checked on the app and the data is there. Do you know how to solve this?
For some reason I cannot load lap data for any quali or race session before 2018. I just keep getting the message "No data for this session! Are you sure this session wasn't cancelled?" but then in 2018 the lap data magically appears.
Looking for the specific requests that fail and why, I get this when I got the URL for a race pre-2018:
NoSuchKey
The specified key does not exist.
Not sure what to do from here.
I'm trying to install a package, but I get this pip install git+https://github.com/theOehrly/Fast-F1.git
ERROR: Command errored out with exit status 1: git clone -q https://github.com/theOehrly/Fast-F1.git /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-ehpkyp7m Check the logs for full command output.
if I do so pip install https://github.com/theOehrly/Fast-F1.git
Collecting https://github.com/theOehrly/Fast-F1.git
Downloading https://github.com/theOehrly/Fast-F1.git
- 140 kB 423 kB/s
ERROR: Cannot unpack file /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-unpack-35yll40n/Fast-F1.git (downloaded from /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-att_ycjf, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-att_ycjf
Hi, I know I can use pick_fastest() to get lap with best LapTime, but is it posible to pick a specific lap (i.e Lap 10 from race). I want to see the speed of a specific lap of a certain driver. Thank you!
Traceback (most recent call last): File "main.py", line 22, in <module> giri = sess.load_laps() File "/home/**/.local/lib/python3.8/site-packages/fastf1/utils.py", line 61, in decorator return func(*args, **kwargs) File "/home/**/.local/lib/python3.8/site-packages/fastf1/core.py", line 252, in load_laps self.laps = Laps(self._load_summary()) File "/home/**/.local/lib/python3.8/site-packages/fastf1/core.py", line 324, in _load_summary t_map = {r['number']: r['Constructor']['name'] for r in self.results} AttributeError: 'Session' object has no attribute 'results'
Hi! I wanted to know if it is possible to get the telemetry of a crash on lap 1.(Sainz in sochi 2020 for example) Looks like there is no data recorded for his car, so we cannot access even the start of the first lap.
Any suggestions to access to it?
Thanks
Hey I'm getting the following error from the example code in the Readme. Any idea what's going on?
core INFO Loading laps for Turkish Grand Prix - Race [v2.1.6]
api INFO Using cached data for timing_data
api INFO Using cached data for timing_app_data
core INFO Processing timing data...
api INFO Using cached data for session_status_data
api INFO Using cached data for track_status_data
api INFO Using cached data for weather_data
core INFO Loaded data for 20 drivers: ['18', '33', '11', '23', '3', '44', '31', '7', '77', '99', '5', '16', '20', '4', '55', '26', '8', '6', '10', '63']
Traceback (most recent call last):
File "c:\Users\ahale\Documents\lec-ham-ex.py", line 15, in <module>
ax.plot(lec['LapNumber'], lec['LapTime'], color='red')
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_axes.py", line 1646, in plot
lines = [*self._get_lines(*args, data=data, **kwargs)]
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_base.py", line 216, in __call__
yield from self._plot_args(this, kwargs)
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_base.py", line 337, in _plot_args
self.axes.xaxis.update_units(x)
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axis.py", line 1510, in update_units
converter = munits.registry.get_converter(data)
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\timple\patches.py", line 115, in get_converter
if np.iterable(x) and hasattr(x[0], 'value'):
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\series.py", line 871, in __getitem__
result = self.index.get_value(self, key)
File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexes\base.py", line 4405, in get_value
return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None))
File "pandas\_libs\index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value
File "pandas\_libs\index.pyx", line 90, in pandas._libs.index.IndexEngine.get_value
File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas\_libs\hashtable_class_helper.pxi", line 998, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas\_libs\hashtable_class_helper.pxi", line 1005, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 0
As the title suggests, the program does not work for FP1, FP3 and Q of the Sakhir Grand Prix. The return of the data fetch is None
It seems that now livetiming.formula1.com has all telemetry data available after session. So probably no longer need to record the live timing data during a session. Below is the data for Imola race:
Hello, first of all very nice work on fastf1. I was wondering if it is possible to get information about a season? Like the number of races, or a list with the races.
Different question: is it possible to get a session/weekend/race by date instead of year and gp name?
Kind regards, Tijmen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.