Spaces:
Running
Running
James McCool
commited on
Commit
·
e25cbc1
1
Parent(s):
15bd131
Update prop variable names in app.py for consistency and clarity. Changed 'NHL_GAME_PLAYER_BLOCKED_SHOTS' to 'NHL_GAME_PLAYER_SHOTS_BLOCKED' across multiple instances to ensure uniformity in prop category references, enhancing code readability and maintainability.
Browse files
app.py
CHANGED
@@ -55,10 +55,10 @@ def init_conn():
|
|
55 |
|
56 |
gcservice_account, gcservice_account2, NHL_Data = init_conn()
|
57 |
|
58 |
-
prop_table_options = ['NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_POINTS', '
|
59 |
prop_format = {'L5 Success': '{:.2%}', 'L10_Success': '{:.2%}', 'L20_success': '{:.2%}', 'Matchup Boost': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
|
60 |
'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
|
61 |
-
all_sim_vars = ['NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_POINTS', '
|
62 |
pick6_sim_vars = ['Points', 'Shots on Goal', 'Assists', 'Blocks']
|
63 |
sim_all_hold = pd.DataFrame(columns=['Player', 'Prop Type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Trending Over', 'Over%', 'Imp Under', 'Trending Under', 'Under%', 'Bet?', 'Edge'])
|
64 |
|
@@ -188,7 +188,7 @@ with tab3:
|
|
188 |
book_selections = ['Pick6']
|
189 |
with col3:
|
190 |
if game_select_var == 'Aggregate':
|
191 |
-
prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_ASSISTS', '
|
192 |
elif game_select_var == 'Pick6':
|
193 |
prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'Points', 'Shots on Goal', 'Assists', 'Blocks'])
|
194 |
with col4:
|
@@ -206,7 +206,7 @@ with tab3:
|
|
206 |
|
207 |
if game_select_var == 'Aggregate':
|
208 |
prop_df_raw = prop_trends[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type', 'Trending Over', 'Trending Under']]
|
209 |
-
sim_vars = ['NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_ASSISTS', '
|
210 |
elif game_select_var == 'Pick6':
|
211 |
prop_df_raw = pick_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type', 'Trending Over', 'Trending Under']]
|
212 |
sim_vars = ['Points', 'Shots on Goal', 'Assists', 'Blocks']
|
@@ -251,7 +251,7 @@ with tab3:
|
|
251 |
df['Median'] = df['Player SOG']
|
252 |
elif prop == 'NHL_GAME_PLAYER_ASSISTS' or prop == 'Assists':
|
253 |
df['Median'] = df['Player Assists']
|
254 |
-
elif prop == '
|
255 |
df['Median'] = df['Player Blocks']
|
256 |
|
257 |
flex_file = df.copy()
|
@@ -341,8 +341,8 @@ with tab3:
|
|
341 |
prop_df = prop_df[prop_df['prop_type'] == 'NHL_GAME_PLAYER_ASSISTS']
|
342 |
elif prop_type_var == "Assists":
|
343 |
prop_df = prop_df[prop_df['prop_type'] == 'Player Assists']
|
344 |
-
elif prop_type_var == "
|
345 |
-
prop_df = prop_df[prop_df['prop_type'] == '
|
346 |
elif prop_type_var == "Blocks":
|
347 |
prop_df = prop_df[prop_df['prop_type'] == 'Player Blocks']
|
348 |
|
@@ -379,7 +379,7 @@ with tab3:
|
|
379 |
df['Median'] = df['Player SOG']
|
380 |
elif prop_type_var == 'NHL_GAME_PLAYER_ASSISTS' or prop_type_var == 'Assists':
|
381 |
df['Median'] = df['Player Assists']
|
382 |
-
elif prop_type_var == '
|
383 |
df['Median'] = df['Player Blocks']
|
384 |
|
385 |
flex_file = df.copy()
|
|
|
55 |
|
56 |
gcservice_account, gcservice_account2, NHL_Data = init_conn()
|
57 |
|
58 |
+
prop_table_options = ['NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_BLOCKED', 'NHL_GAME_PLAYER_ASSISTS']
|
59 |
prop_format = {'L5 Success': '{:.2%}', 'L10_Success': '{:.2%}', 'L20_success': '{:.2%}', 'Matchup Boost': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
|
60 |
'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
|
61 |
+
all_sim_vars = ['NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_BLOCKED', 'NHL_GAME_PLAYER_ASSISTS']
|
62 |
pick6_sim_vars = ['Points', 'Shots on Goal', 'Assists', 'Blocks']
|
63 |
sim_all_hold = pd.DataFrame(columns=['Player', 'Prop Type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Trending Over', 'Over%', 'Imp Under', 'Trending Under', 'Under%', 'Bet?', 'Edge'])
|
64 |
|
|
|
188 |
book_selections = ['Pick6']
|
189 |
with col3:
|
190 |
if game_select_var == 'Aggregate':
|
191 |
+
prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_ASSISTS', 'NHL_GAME_PLAYER_SHOTS_BLOCKED'])
|
192 |
elif game_select_var == 'Pick6':
|
193 |
prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'Points', 'Shots on Goal', 'Assists', 'Blocks'])
|
194 |
with col4:
|
|
|
206 |
|
207 |
if game_select_var == 'Aggregate':
|
208 |
prop_df_raw = prop_trends[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type', 'Trending Over', 'Trending Under']]
|
209 |
+
sim_vars = ['NHL_GAME_PLAYER_POINTS', 'NHL_GAME_PLAYER_SHOTS_ON_GOAL', 'NHL_GAME_PLAYER_ASSISTS', 'NHL_GAME_PLAYER_SHOTS_BLOCKED']
|
210 |
elif game_select_var == 'Pick6':
|
211 |
prop_df_raw = pick_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type', 'Trending Over', 'Trending Under']]
|
212 |
sim_vars = ['Points', 'Shots on Goal', 'Assists', 'Blocks']
|
|
|
251 |
df['Median'] = df['Player SOG']
|
252 |
elif prop == 'NHL_GAME_PLAYER_ASSISTS' or prop == 'Assists':
|
253 |
df['Median'] = df['Player Assists']
|
254 |
+
elif prop == 'NHL_GAME_PLAYER_SHOTS_BLOCKED' or prop == 'Blocks':
|
255 |
df['Median'] = df['Player Blocks']
|
256 |
|
257 |
flex_file = df.copy()
|
|
|
341 |
prop_df = prop_df[prop_df['prop_type'] == 'NHL_GAME_PLAYER_ASSISTS']
|
342 |
elif prop_type_var == "Assists":
|
343 |
prop_df = prop_df[prop_df['prop_type'] == 'Player Assists']
|
344 |
+
elif prop_type_var == "NHL_GAME_PLAYER_SHOTS_BLOCKED":
|
345 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NHL_GAME_PLAYER_SHOTS_BLOCKED']
|
346 |
elif prop_type_var == "Blocks":
|
347 |
prop_df = prop_df[prop_df['prop_type'] == 'Player Blocks']
|
348 |
|
|
|
379 |
df['Median'] = df['Player SOG']
|
380 |
elif prop_type_var == 'NHL_GAME_PLAYER_ASSISTS' or prop_type_var == 'Assists':
|
381 |
df['Median'] = df['Player Assists']
|
382 |
+
elif prop_type_var == 'NHL_GAME_PLAYER_SHOTS_BLOCKED' or prop_type_var == 'Blocks':
|
383 |
df['Median'] = df['Player Blocks']
|
384 |
|
385 |
flex_file = df.copy()
|