F1-analysis / pages /Race_Launch_Performance_Ratings.py
tracinginsights's picture
Update pages/Race_Launch_Performance_Ratings.py
cee762a
raw
history blame
831 Bytes
import streamlit as st
from repo_directory import Race_Launch_Performance_Ratings as rl
from repo_directory import button
YEAR_SELECTED = st.selectbox(
'Select Year',
(2023, 2022, 2021, 2020, 2019, 2018))
RACE_SELECTED = st.selectbox(
'Select Race',
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23))
SESSION = st.selectbox(
'Select Session',
('R', 'SQ'))
reaction_df, drivers, laps = rl.get_laps_and_drivers(YEAR_SELECTED, RACE_SELECTED, SESSION)
DRIVERS_REMOVED = st.multiselect(
'Remove drivers starting from pitlane',
drivers.tolist()
)
REMAINING_DRIVERS = list(set(drivers.tolist()) - set(DRIVERS_REMOVED))
ratings_df = rl.get_ratings(laps, drivers, reaction_df, REMAINING_DRIVERS)
rl.plot_ratings(ratings_df,YEAR_SELECTED, RACE_SELECTED, SESSION)