James McCool commited on
Commit
d9a30f7
·
1 Parent(s): f68d184

Enhance dataframe styling in streamlit_app.py by adding a reverse color gradient for 'Spread Diff' to improve visual distinction.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -3
src/streamlit_app.py CHANGED
@@ -172,13 +172,13 @@ if selected_tab == 'Game Betting Model':
172
  team_frame = team_frame[['Team', 'Opp', 'Win%', 'Vegas', 'Win% Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff']]
173
  team_frame = team_frame.set_index('Team')
174
  try:
175
- st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
176
  except:
177
- st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
178
  if line_var1 == 'American':
179
  team_frame = team_frame[['Team', 'Opp', 'Win Line', 'Vegas Line', 'Line Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff']]
180
  team_frame = team_frame.set_index('Team')
181
- st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height = 1000, use_container_width = True)
182
 
183
  st.download_button(
184
  label="Export Team Model",
 
172
  team_frame = team_frame[['Team', 'Opp', 'Win%', 'Vegas', 'Win% Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff']]
173
  team_frame = team_frame.set_index('Team')
174
  try:
175
+ st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Spread Diff']).format(game_format, precision=2), use_container_width = True)
176
  except:
177
+ st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Spread Diff']).format(precision=2), use_container_width = True)
178
  if line_var1 == 'American':
179
  team_frame = team_frame[['Team', 'Opp', 'Win Line', 'Vegas Line', 'Line Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff']]
180
  team_frame = team_frame.set_index('Team')
181
+ st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').background_gradient(cmap='RdYlGn_r', subset=['Spread Diff']).format(precision=2), height = 1000, use_container_width = True)
182
 
183
  st.download_button(
184
  label="Export Team Model",