Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,6 +57,8 @@ def init_baselines():
|
|
| 57 |
team_frame = team_frame.drop_duplicates(subset='Names')
|
| 58 |
team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 59 |
team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
|
|
|
|
|
|
| 60 |
|
| 61 |
worksheet = sh.worksheet('prop_frame')
|
| 62 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
|
@@ -89,11 +91,11 @@ with tab1:
|
|
| 89 |
pitcher_stats, hitter_stats, team_frame, prop_frame, betsheet_frame, pick_frame, t_stamp = init_baselines()
|
| 90 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
| 91 |
if line_var1 == 'Percentage':
|
| 92 |
-
team_frame = team_frame[['Names', 'Game', 'Win Percentage', 'Spread', 'Cover Spread Percentage', 'Avg Score', 'Game Total', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage']]
|
| 93 |
team_frame = team_frame.set_index('Names')
|
| 94 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
|
| 95 |
if line_var1 == 'American':
|
| 96 |
-
team_frame = team_frame[['Names', 'Game', 'American ML', 'Spread', 'American Cover', 'Avg Score', 'Game Total', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage']]
|
| 97 |
team_frame.rename(columns={"American ML": "Win Percentage", "American Cover": "Cover Spread Percentage"}, inplace = True)
|
| 98 |
team_frame = team_frame.set_index('Names')
|
| 99 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(american_format, precision=2), use_container_width = True)
|
|
|
|
| 57 |
team_frame = team_frame.drop_duplicates(subset='Names')
|
| 58 |
team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 59 |
team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
| 60 |
+
team_frame['ML_Value'] = team_frame['ML_Value'].str.replace('%', '').astype('float')/100
|
| 61 |
+
team_frame['Spread_Value'] = team_frame['Spread_Value'].str.replace('%', '').astype('float')/100
|
| 62 |
|
| 63 |
worksheet = sh.worksheet('prop_frame')
|
| 64 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
|
|
|
| 91 |
pitcher_stats, hitter_stats, team_frame, prop_frame, betsheet_frame, pick_frame, t_stamp = init_baselines()
|
| 92 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
| 93 |
if line_var1 == 'Percentage':
|
| 94 |
+
team_frame = team_frame[['Names', 'Game', 'Moneyline', 'Win Percentage', 'ML_Value', 'Spread', 'Cover Spread Percentage', 'Spread_Value', 'Avg Score', 'Game Total', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage']]
|
| 95 |
team_frame = team_frame.set_index('Names')
|
| 96 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), use_container_width = True)
|
| 97 |
if line_var1 == 'American':
|
| 98 |
+
team_frame = team_frame[['Names', 'Game', 'Moneyline, 'American ML', 'ML_Value', 'Spread', 'American Cover', 'Spread_Value', 'Avg Score', 'Game Total', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage']]
|
| 99 |
team_frame.rename(columns={"American ML": "Win Percentage", "American Cover": "Cover Spread Percentage"}, inplace = True)
|
| 100 |
team_frame = team_frame.set_index('Names')
|
| 101 |
st.dataframe(team_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(american_format, precision=2), use_container_width = True)
|