-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Key error when finding driver colours #538
Comments
From the docs:
That is to say, it might give you a color that doesn't reflect the driver's past team. Or if the driver is no longer in F1, it will generate undefined behavior. For working with previous seasons, I recommend defining a color map explicitly or using some sort of fall back values. For my own project I have this bandaid solution:
|
I implemented the function and it works well on some races. However, it is giving me this error frequently now:
Apparently there is an issue with the |
Print out the dimension of drive_laps for sanity check. You might be getting empty slices |
The original error is likely related to the fact that you are (most likely) using a FastF1 version before 3.1.0. At least, this is the only way for me to reproduce the problem. The 2023 GP had Lawson driving as replacement for Ricciardo and Lawson was only added with v3.1.0. Apart from that, as suggested already, for the second error, verify that |
Describe the issue:
I am running a simple variation of one of the example projects, but when I run certain sessions (in this case 2023 Dutch Grand Prix but seemingly anything pre-2020), a KeyError is raised trying to get the driver_colour.
Reproduce the code example:
Error message:
The text was updated successfully, but these errors were encountered: