Spaces:
Running
Running
James McCool
commited on
Commit
·
677e8ce
1
Parent(s):
ab05fc3
added slate toggles
Browse files
app.py
CHANGED
|
@@ -262,6 +262,7 @@ with tab1:
|
|
| 262 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 263 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 264 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
|
|
|
| 265 |
split_var1 = st.radio("Would you like to view the whole slate or just specific games?", ('Full Slate Run', 'Specific Games'), key='split_var1')
|
| 266 |
if split_var1 == 'Specific Games':
|
| 267 |
team_var1 = st.multiselect('Which teams would you like to include in the ROO?', options = player_frame['Team'].unique(), key='team_var1')
|
|
@@ -276,7 +277,7 @@ with tab1:
|
|
| 276 |
|
| 277 |
final_Proj = player_frame[player_frame['Site'] == str(site_var)]
|
| 278 |
final_Proj = final_Proj[final_Proj['Type'] == 'Basic']
|
| 279 |
-
final_Proj = final_Proj[final_Proj['Slate'] ==
|
| 280 |
final_Proj = final_Proj[player_frame['Team'].isin(team_var1)]
|
| 281 |
final_Proj = final_Proj[final_Proj['Salary'] >= sal_var1[0]]
|
| 282 |
final_Proj = final_Proj[final_Proj['Salary'] <= sal_var1[1]]
|
|
@@ -341,11 +342,12 @@ with tab2:
|
|
| 341 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 342 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 343 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
|
|
|
| 344 |
sal_var2 = st.slider("Is there a certain price range you want to view?", 5000, 40000, (5000, 40000), key='sal_var2')
|
| 345 |
|
| 346 |
final_line_combos = line_frame[line_frame['Site'] == str(site_var)]
|
| 347 |
final_line_combos = final_line_combos[final_line_combos['Type'] == 'Basic']
|
| 348 |
-
final_line_combos = final_line_combos[final_line_combos['Slate'] ==
|
| 349 |
final_line_combos = final_line_combos[final_line_combos['Salary'] >= sal_var2[0]]
|
| 350 |
final_line_combos = final_line_combos[final_line_combos['Salary'] <= sal_var2[1]]
|
| 351 |
final_line_combos = final_line_combos.drop_duplicates(subset=['Player'])
|
|
@@ -381,11 +383,12 @@ with tab3:
|
|
| 381 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 382 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 383 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
|
|
|
| 384 |
sal_var3 = st.slider("Is there a certain price range you want to view?", 5000, 40000, (5000, 40000), key='sal_var3')
|
| 385 |
|
| 386 |
final_pp_combos = pp_frame[pp_frame['Site'] == str(site_var)]
|
| 387 |
final_pp_combos = final_pp_combos[final_pp_combos['Type'] == 'Basic']
|
| 388 |
-
final_pp_combos = final_pp_combos[final_pp_combos['Slate'] ==
|
| 389 |
final_pp_combos = final_pp_combos[final_pp_combos['Salary'] >= sal_var3[0]]
|
| 390 |
final_pp_combos = final_pp_combos[final_pp_combos['Salary'] <= sal_var3[1]]
|
| 391 |
final_pp_combos = final_pp_combos.drop_duplicates(subset=['Player'])
|
|
@@ -438,9 +441,9 @@ with tab4:
|
|
| 438 |
elif site_var == 'Fanduel':
|
| 439 |
raw_baselines = player_frame[player_frame['Site'] == 'Fanduel']
|
| 440 |
if site_var == 'Draftkings':
|
| 441 |
-
|
| 442 |
elif site_var == 'Fanduel':
|
| 443 |
-
|
| 444 |
|
| 445 |
with optimals_macro_col:
|
| 446 |
lineup_num_var = st.number_input("How many lineups do you want to display?", min_value=1, max_value=1000, value=150, step=1, key='lineup_num_var_input')
|
|
@@ -448,14 +451,14 @@ with tab4:
|
|
| 448 |
|
| 449 |
if type_var == 'Regular':
|
| 450 |
if site_var == 'Draftkings':
|
| 451 |
-
dk_lineups = init_DK_lineups(prio_var, prio_mix, lineup_num, player_var2,
|
| 452 |
elif site_var == 'Fanduel':
|
| 453 |
-
fd_lineups = init_FD_lineups(prio_var, prio_mix, lineup_num, player_var2,
|
| 454 |
elif type_var == 'Showdown':
|
| 455 |
if site_var == 'Draftkings':
|
| 456 |
-
dk_lineups = init_DK_lineups(prio_var, prio_mix, lineup_num, player_var2,
|
| 457 |
elif site_var == 'Fanduel':
|
| 458 |
-
fd_lineups = init_FD_lineups(prio_var, prio_mix, lineup_num, player_var2,
|
| 459 |
|
| 460 |
with optimals_salary_col:
|
| 461 |
if site_var == 'Draftkings':
|
|
|
|
| 262 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 263 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 264 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 265 |
+
slate_var1 = st.selectbox("Which slate would you like to view?", ('Main Slate', 'Secondary Slate', 'Auxiliary Slate'), key='slate_var1')
|
| 266 |
split_var1 = st.radio("Would you like to view the whole slate or just specific games?", ('Full Slate Run', 'Specific Games'), key='split_var1')
|
| 267 |
if split_var1 == 'Specific Games':
|
| 268 |
team_var1 = st.multiselect('Which teams would you like to include in the ROO?', options = player_frame['Team'].unique(), key='team_var1')
|
|
|
|
| 277 |
|
| 278 |
final_Proj = player_frame[player_frame['Site'] == str(site_var)]
|
| 279 |
final_Proj = final_Proj[final_Proj['Type'] == 'Basic']
|
| 280 |
+
final_Proj = final_Proj[final_Proj['Slate'] == slate_var1]
|
| 281 |
final_Proj = final_Proj[player_frame['Team'].isin(team_var1)]
|
| 282 |
final_Proj = final_Proj[final_Proj['Salary'] >= sal_var1[0]]
|
| 283 |
final_Proj = final_Proj[final_Proj['Salary'] <= sal_var1[1]]
|
|
|
|
| 342 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 343 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 344 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 345 |
+
slate_var2 = st.selectbox("Which slate would you like to view?", ('Main Slate', 'Secondary Slate', 'Auxiliary Slate'), key='slate_var2')
|
| 346 |
sal_var2 = st.slider("Is there a certain price range you want to view?", 5000, 40000, (5000, 40000), key='sal_var2')
|
| 347 |
|
| 348 |
final_line_combos = line_frame[line_frame['Site'] == str(site_var)]
|
| 349 |
final_line_combos = final_line_combos[final_line_combos['Type'] == 'Basic']
|
| 350 |
+
final_line_combos = final_line_combos[final_line_combos['Slate'] == slate_var2]
|
| 351 |
final_line_combos = final_line_combos[final_line_combos['Salary'] >= sal_var2[0]]
|
| 352 |
final_line_combos = final_line_combos[final_line_combos['Salary'] <= sal_var2[1]]
|
| 353 |
final_line_combos = final_line_combos.drop_duplicates(subset=['Player'])
|
|
|
|
| 383 |
dk_lineups = init_DK_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 384 |
fd_lineups = init_FD_lineups('proj', 50, 25000, [], 'Main Slate')
|
| 385 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 386 |
+
slate_var3 = st.selectbox("Which slate would you like to view?", ('Main Slate', 'Secondary Slate', 'Auxiliary Slate'), key='slate_var3')
|
| 387 |
sal_var3 = st.slider("Is there a certain price range you want to view?", 5000, 40000, (5000, 40000), key='sal_var3')
|
| 388 |
|
| 389 |
final_pp_combos = pp_frame[pp_frame['Site'] == str(site_var)]
|
| 390 |
final_pp_combos = final_pp_combos[final_pp_combos['Type'] == 'Basic']
|
| 391 |
+
final_pp_combos = final_pp_combos[final_pp_combos['Slate'] == slate_var3]
|
| 392 |
final_pp_combos = final_pp_combos[final_pp_combos['Salary'] >= sal_var3[0]]
|
| 393 |
final_pp_combos = final_pp_combos[final_pp_combos['Salary'] <= sal_var3[1]]
|
| 394 |
final_pp_combos = final_pp_combos.drop_duplicates(subset=['Player'])
|
|
|
|
| 441 |
elif site_var == 'Fanduel':
|
| 442 |
raw_baselines = player_frame[player_frame['Site'] == 'Fanduel']
|
| 443 |
if site_var == 'Draftkings':
|
| 444 |
+
slate_var4 = st.radio("Which slate data are you loading?", (['Main Slate', 'Secondary Slate', 'Auxiliary Slate']), key='slate_var4_radio')
|
| 445 |
elif site_var == 'Fanduel':
|
| 446 |
+
slate_var4 = st.radio("Which slate data are you loading?", (['Main Slate', 'Secondary Slate', 'Auxiliary Slate']), key='slate_var4_radio')
|
| 447 |
|
| 448 |
with optimals_macro_col:
|
| 449 |
lineup_num_var = st.number_input("How many lineups do you want to display?", min_value=1, max_value=1000, value=150, step=1, key='lineup_num_var_input')
|
|
|
|
| 451 |
|
| 452 |
if type_var == 'Regular':
|
| 453 |
if site_var == 'Draftkings':
|
| 454 |
+
dk_lineups = init_DK_lineups(prio_var, prio_mix, lineup_num, player_var2, slate_var4)
|
| 455 |
elif site_var == 'Fanduel':
|
| 456 |
+
fd_lineups = init_FD_lineups(prio_var, prio_mix, lineup_num, player_var2, slate_var4)
|
| 457 |
elif type_var == 'Showdown':
|
| 458 |
if site_var == 'Draftkings':
|
| 459 |
+
dk_lineups = init_DK_lineups(prio_var, prio_mix, lineup_num, player_var2, slate_var4)
|
| 460 |
elif site_var == 'Fanduel':
|
| 461 |
+
fd_lineups = init_FD_lineups(prio_var, prio_mix, lineup_num, player_var2, slate_var4)
|
| 462 |
|
| 463 |
with optimals_salary_col:
|
| 464 |
if site_var == 'Draftkings':
|