Spaces:
Running
Running
tracinginsights
commited on
Commit
•
75185de
1
Parent(s):
4314369
Update pages/Average_Race_Pace.py
Browse files- pages/Average_Race_Pace.py +21 -0
pages/Average_Race_Pace.py
CHANGED
@@ -2,3 +2,24 @@ import streamlit as st
|
|
2 |
from repo_directory import Average_Race_Pace
|
3 |
from repo_directory import button
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from repo_directory import Average_Race_Pace
|
3 |
from repo_directory import button
|
4 |
|
5 |
+
Average_Race_Pace.get_latest_ergast()
|
6 |
+
drivers_df, laps_df, race_names_df, results_df, available_years = Average_Race_Pace.load_data()
|
7 |
+
|
8 |
+
YEAR_SELECTED = st.selectbox(
|
9 |
+
'Select Year',
|
10 |
+
available_years)
|
11 |
+
|
12 |
+
available_races = race_names_df[race_names_df.year == YEAR_SELECTED].name.tolist()
|
13 |
+
|
14 |
+
|
15 |
+
RACE_SELECTED = st.selectbox(
|
16 |
+
'Select Race',
|
17 |
+
available_races)
|
18 |
+
|
19 |
+
|
20 |
+
SELECTED_RACEID = race_names_df[
|
21 |
+
(race_names_df.year == YEAR_SELECTED) & (race_names_df.name == RACE_SELECTED)
|
22 |
+
].raceId.values[0]
|
23 |
+
|
24 |
+
|
25 |
+
Average_Race_Pace.plot(laps_df,SELECTED_RACEID,drivers_df, )
|