File size: 714 Bytes
7a93088
 
 
47fabfe
7a93088
 
 
 
232ffeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import streamlit as st
from repo_directory import Lap_Chart
from repo_directory import button
import pandas as pd


Lap_Chart.get_latest_ergast()


# select year
race_names_df = pd.read_csv("ergast/races.csv")
available_years = race_names_df.year.unique().tolist()
available_years.sort(reverse=True)
YEAR_SELECTED = st.selectbox(
    'Select year',
    available_years)



# select race
available_races = race_names_df[race_names_df.year == YEAR_SELECTED].name.tolist()


RACE_SELECTED = st.selectbox(
    'Select Race',
    available_races)

SELECTED_RACEID = race_names_df[
    (race_names_df.year == YEAR_SELECTED) & (race_names_df.name == RACE_SELECTED)
].raceId.values[0]


Lap_Chart.plot(SELECTED_RACEID, )