Spaces:
Running
Running
James McCool
commited on
Commit
·
6774173
1
Parent(s):
bac6470
still struggling with the pick6 loop
Browse files
app.py
CHANGED
@@ -413,18 +413,19 @@ with tab5:
|
|
413 |
if prop_type_var == 'All Props':
|
414 |
if game_select_var == 'Aggregate':
|
415 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
|
|
416 |
elif game_select_var == 'Pick6':
|
417 |
prop_df_raw = pick_frame[['Full_name', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
418 |
prop_df_raw.rename(columns={"Full_name": "Player"}, inplace = True)
|
419 |
-
|
420 |
-
if game_select_var == 'Aggregate':
|
421 |
-
sim_vars = ['NBA_GAME_PLAYER_POINTS', 'NBA_GAME_PLAYER_REBOUNDS', 'NBA_GAME_PLAYER_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS', 'NBA_GAME_PLAYER_POINTS_ASSISTS', 'NBA_GAME_PLAYER_REBOUNDS_ASSISTS']
|
422 |
-
elif game_select_var == 'Pick6':
|
423 |
sim_vars = ['Points', 'Rebounds', 'Assists', 'Points + Assists + Rebounds', 'Points + Assists', 'Points + Rebounds', 'Assists + Rebounds']
|
|
|
|
|
|
|
424 |
for prop in sim_vars:
|
|
|
|
|
425 |
prop_df = prop_df_raw.loc[prop_df_raw['prop_type'] == prop]
|
426 |
-
|
427 |
-
|
428 |
for books in book_selections:
|
429 |
prop_df = prop_df.loc[prop_df['book'] == books]
|
430 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
@@ -444,8 +445,6 @@ with tab5:
|
|
444 |
|
445 |
df = player_df.reset_index(drop=True)
|
446 |
|
447 |
-
st.table(df)
|
448 |
-
|
449 |
team_dict = dict(zip(df.Player, df.Team))
|
450 |
|
451 |
total_sims = 1000
|
@@ -672,8 +671,7 @@ with tab5:
|
|
672 |
if game_select_var == 'Pick6':
|
673 |
final_outcomes = final_outcomes.drop_duplicates(subset=['Player', 'Prop Type'])
|
674 |
final_outcomes = final_outcomes.sort_values(by='Edge', ascending=False)
|
675 |
-
|
676 |
-
st.dataframe(pick_frame.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
677 |
with df_hold_container:
|
678 |
df_hold_container = st.empty()
|
679 |
st.dataframe(final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
413 |
if prop_type_var == 'All Props':
|
414 |
if game_select_var == 'Aggregate':
|
415 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
416 |
+
sim_vars = ['NBA_GAME_PLAYER_POINTS', 'NBA_GAME_PLAYER_REBOUNDS', 'NBA_GAME_PLAYER_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS_ASSISTS', 'NBA_GAME_PLAYER_POINTS_REBOUNDS', 'NBA_GAME_PLAYER_POINTS_ASSISTS', 'NBA_GAME_PLAYER_REBOUNDS_ASSISTS']
|
417 |
elif game_select_var == 'Pick6':
|
418 |
prop_df_raw = pick_frame[['Full_name', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
419 |
prop_df_raw.rename(columns={"Full_name": "Player"}, inplace = True)
|
|
|
|
|
|
|
|
|
420 |
sim_vars = ['Points', 'Rebounds', 'Assists', 'Points + Assists + Rebounds', 'Points + Assists', 'Points + Rebounds', 'Assists + Rebounds']
|
421 |
+
|
422 |
+
player_df = player_stats.copy()
|
423 |
+
|
424 |
for prop in sim_vars:
|
425 |
+
st.write(prop)
|
426 |
+
st.table(prop_df_raw)
|
427 |
prop_df = prop_df_raw.loc[prop_df_raw['prop_type'] == prop]
|
428 |
+
|
|
|
429 |
for books in book_selections:
|
430 |
prop_df = prop_df.loc[prop_df['book'] == books]
|
431 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
|
|
445 |
|
446 |
df = player_df.reset_index(drop=True)
|
447 |
|
|
|
|
|
448 |
team_dict = dict(zip(df.Player, df.Team))
|
449 |
|
450 |
total_sims = 1000
|
|
|
671 |
if game_select_var == 'Pick6':
|
672 |
final_outcomes = final_outcomes.drop_duplicates(subset=['Player', 'Prop Type'])
|
673 |
final_outcomes = final_outcomes.sort_values(by='Edge', ascending=False)
|
674 |
+
|
|
|
675 |
with df_hold_container:
|
676 |
df_hold_container = st.empty()
|
677 |
st.dataframe(final_outcomes.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|