Cant get rid of this error

Hey guys,
I am trying to write this piece of code but its throwing keyerror:0

for i, (d1_time, d2_time) in enumerate(zip(driver1_speed, driver2_speed)):
    if d1_time < d2_time:
        fig.add_annotation(x=driver1_fastest.telemetry['X'][i], y=driver1_fastest.telemetry['Y'][i], text='Driver 1', showarrow=False)
    elif d2_time < d1_time:
        fig.add_annotation(x=driver2_fastest.telemetry['X'][i], y=driver2_fastest.telemetry['Y'][i], text='Driver 2', showarrow=False)

Thanks in advance.

Hi @MJF welcome to the forums!

The error is not related to plotly, simply one of your dictionaries does not have a key 0. If you think it should have, maybe try “0”