Update app.py
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ with tab1:
|
|
| 110 |
elif split_var1 == 'All':
|
| 111 |
team_var1 = game_model.Acro.values.tolist()
|
| 112 |
date_split_var1 = st.radio("Would you like to view all Dates or specific ones?", ('All', 'Specific Dates'), key='date_split_var1')
|
| 113 |
-
if date_split_var1 == 'Specific
|
| 114 |
date_var1 = st.multiselect('Which Dates would you like to include in the tables?', options = game_model['Date'].unique(), key='date_var1')
|
| 115 |
elif date_split_var1 == 'All':
|
| 116 |
date_var1 = game_model.Date.values.tolist()
|
|
@@ -138,9 +138,21 @@ with tab2:
|
|
| 138 |
team_var2 = st.multiselect('Which teams would you like to include in the tables?', options = season_model['Team'].unique(), key='team_var2')
|
| 139 |
elif split_var2 == 'All':
|
| 140 |
team_var2 = season_model.Team.values.tolist()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
with col2:
|
| 142 |
if view_var2 == 'Win Odds':
|
| 143 |
title_sims = title_sims[title_sims['Team'].isin(team_var2)]
|
|
|
|
|
|
|
| 144 |
season_display = title_sims.set_index('Team')
|
| 145 |
season_display = season_display.sort_values(by=['Win Projection Now'], ascending=False)
|
| 146 |
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
|
@@ -152,8 +164,10 @@ with tab2:
|
|
| 152 |
)
|
| 153 |
elif view_var2 == 'Seed Probabilities':
|
| 154 |
seed_probs = seed_probs[seed_probs['Team'].isin(team_var2)]
|
|
|
|
|
|
|
| 155 |
season_display = seed_probs.set_index('Team')
|
| 156 |
-
season_display = season_display.sort_values(by=['
|
| 157 |
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 158 |
st.download_button(
|
| 159 |
label="Export Futures Model",
|
|
|
|
| 110 |
elif split_var1 == 'All':
|
| 111 |
team_var1 = game_model.Acro.values.tolist()
|
| 112 |
date_split_var1 = st.radio("Would you like to view all Dates or specific ones?", ('All', 'Specific Dates'), key='date_split_var1')
|
| 113 |
+
if date_split_var1 == 'Specific Dates':
|
| 114 |
date_var1 = st.multiselect('Which Dates would you like to include in the tables?', options = game_model['Date'].unique(), key='date_var1')
|
| 115 |
elif date_split_var1 == 'All':
|
| 116 |
date_var1 = game_model.Date.values.tolist()
|
|
|
|
| 138 |
team_var2 = st.multiselect('Which teams would you like to include in the tables?', options = season_model['Team'].unique(), key='team_var2')
|
| 139 |
elif split_var2 == 'All':
|
| 140 |
team_var2 = season_model.Team.values.tolist()
|
| 141 |
+
conf_var2 = st.radio("Would you like to view all conferences or specific ones?", ('All', 'Specific Conferences'), key='conf_var2')
|
| 142 |
+
if conf_var2 == 'Specific Conferences':
|
| 143 |
+
conf_choice_var2 = st.multiselect('Which conferences would you like to include in the tables?', options = season_model['Conference'].unique(), key='conf_choice_var2')
|
| 144 |
+
elif conf_var2 == 'All':
|
| 145 |
+
conf_choice_var2 = season_model.Conference.values.tolist()
|
| 146 |
+
div_var2 = st.radio("Would you like to view all divisions or specific ones?", ('All', 'Specific Divisions'), key='div_var2')
|
| 147 |
+
if div_var2 == 'Specific Divisions':
|
| 148 |
+
div_choice_var2 = st.multiselect('Which divisions would you like to include in the tables?', options = season_model['Division'].unique(), key='div_choice_var2')
|
| 149 |
+
elif div_var2 == 'All':
|
| 150 |
+
div_choice_var2 = season_model.Division.values.tolist()
|
| 151 |
with col2:
|
| 152 |
if view_var2 == 'Win Odds':
|
| 153 |
title_sims = title_sims[title_sims['Team'].isin(team_var2)]
|
| 154 |
+
title_sims = title_sims[title_sims['Conference'].isin(conf_choice_var2)]
|
| 155 |
+
title_sims = title_sims[title_sims['Division'].isin(div_choice_var2)]
|
| 156 |
season_display = title_sims.set_index('Team')
|
| 157 |
season_display = season_display.sort_values(by=['Win Projection Now'], ascending=False)
|
| 158 |
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
|
|
|
| 164 |
)
|
| 165 |
elif view_var2 == 'Seed Probabilities':
|
| 166 |
seed_probs = seed_probs[seed_probs['Team'].isin(team_var2)]
|
| 167 |
+
seed_probs = seed_probs[seed_probs['Conference'].isin(conf_choice_var2)]
|
| 168 |
+
seed_probs = seed_probs[seed_probs['Division'].isin(div_choice_var2)]
|
| 169 |
season_display = seed_probs.set_index('Team')
|
| 170 |
+
season_display = season_display.sort_values(by=['Avg Seed'], ascending=True)
|
| 171 |
st.dataframe(season_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(percentages_format, precision=2), use_container_width = True)
|
| 172 |
st.download_button(
|
| 173 |
label="Export Futures Model",
|