Spaces:
Running
Running
tracinginsights
commited on
Commit
•
232ffeb
1
Parent(s):
7a93088
Update pages/Lap_Chart.py
Browse files- pages/Lap_Chart.py +26 -0
pages/Lap_Chart.py
CHANGED
@@ -6,3 +6,29 @@ from repo_directory import button
|
|
6 |
|
7 |
Lap_Chart.get_latest_ergast()
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
Lap_Chart.get_latest_ergast()
|
8 |
|
9 |
+
|
10 |
+
# select year
|
11 |
+
race_names_df = pd.read_csv("ergast/races.csv")
|
12 |
+
available_years = race_names_df.year.unique().tolist()
|
13 |
+
available_years.sort(reverse=True)
|
14 |
+
YEAR_SELECTED = st.selectbox(
|
15 |
+
'Select year',
|
16 |
+
available_years)
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
# select race
|
21 |
+
available_races = race_names_df[race_names_df.year == YEAR_SELECTED].name.tolist()
|
22 |
+
|
23 |
+
|
24 |
+
RACE_SELECTED = st.selectbox(
|
25 |
+
'Select Race',
|
26 |
+
available_races)
|
27 |
+
|
28 |
+
SELECTED_RACEID = race_names_df[
|
29 |
+
(race_names_df.year == YEAR_SELECTED) & (race_names_df.name == RACE_SELECTED)
|
30 |
+
].raceId.values[0]
|
31 |
+
|
32 |
+
|
33 |
+
Lap_Chart.plot(SELECTED_RACEID, )
|
34 |
+
|