Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -73,8 +73,13 @@ qb_stats = overall_stats.loc[overall_stats['Position'] == 'QB']
|
|
73 |
non_qb_stats = overall_stats.loc[overall_stats['Position'] != 'QB']
|
74 |
timestamp = timestamp_table()
|
75 |
prop_frame = player_prop_table()
|
|
|
76 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
77 |
|
|
|
|
|
|
|
|
|
78 |
tab1, tab2, tab3, tab4, tab5 = st.tabs(["Game Betting Model", "QB Projections", "RB/WR/TE Projections", "Player Prop Simulations", "Stat Specific Simulations"])
|
79 |
|
80 |
def convert_df_to_csv(df):
|
@@ -330,127 +335,246 @@ with tab5:
|
|
330 |
export_container = st.empty()
|
331 |
|
332 |
with col1:
|
333 |
-
prop_type_var = st.selectbox('Select prop category', options = ['
|
|
|
334 |
|
335 |
if st.button('Simulate Prop Category'):
|
336 |
with col2:
|
337 |
|
338 |
with df_hold_container.container():
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
|
451 |
final_outcomes = final_outcomes.sort_values(by='Edge', ascending=False)
|
452 |
-
|
453 |
-
final_outcomes = final_outcomes.set_index('Player')
|
454 |
|
455 |
with df_hold_container:
|
456 |
df_hold_container = st.empty()
|
|
|
73 |
non_qb_stats = overall_stats.loc[overall_stats['Position'] != 'QB']
|
74 |
timestamp = timestamp_table()
|
75 |
prop_frame = player_prop_table()
|
76 |
+
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
77 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
78 |
|
79 |
+
all_sim_vars = ['All Props', 'pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts',
|
80 |
+
'pass_attempts', 'pass_completions']
|
81 |
+
sim_all_hold = pd.DataFrame(columns=['Player', 'Team', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge'])
|
82 |
+
|
83 |
tab1, tab2, tab3, tab4, tab5 = st.tabs(["Game Betting Model", "QB Projections", "RB/WR/TE Projections", "Player Prop Simulations", "Stat Specific Simulations"])
|
84 |
|
85 |
def convert_df_to_csv(df):
|
|
|
335 |
export_container = st.empty()
|
336 |
|
337 |
with col1:
|
338 |
+
prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts',
|
339 |
+
'pass_attempts', 'pass_completions'])
|
340 |
|
341 |
if st.button('Simulate Prop Category'):
|
342 |
with col2:
|
343 |
|
344 |
with df_hold_container.container():
|
345 |
+
if prop_type_var == 'All Props':
|
346 |
+
for prop in all_sim_vars:
|
347 |
+
|
348 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
349 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == prop]
|
350 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
351 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
352 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
353 |
+
st.table(prop_df)
|
354 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
355 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
356 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
357 |
+
|
358 |
+
prop_dict = dict(zip(df.Player, df.Prop))
|
359 |
+
over_dict = dict(zip(df.Player, df.Over))
|
360 |
+
under_dict = dict(zip(df.Player, df.Under))
|
361 |
+
|
362 |
+
total_sims = 5000
|
363 |
+
|
364 |
+
df.replace("", 0, inplace=True)
|
365 |
+
|
366 |
+
if prop_type_var == "pass_yards":
|
367 |
+
df['Median'] = df['pass_yards']
|
368 |
+
elif prop_type_var == "rush_yards":
|
369 |
+
df['Median'] = df['rush_yards']
|
370 |
+
elif prop_type_var == "rec_yards":
|
371 |
+
df['Median'] = df['rec_yards']
|
372 |
+
elif prop_type_var == "receptions":
|
373 |
+
df['Median'] = df['receptions']
|
374 |
+
|
375 |
+
flex_file = df
|
376 |
+
flex_file['Floor'] = flex_file['Median'] * .20
|
377 |
+
flex_file['Ceiling'] = flex_file['Median'] + (flex_file['Median'] * .80)
|
378 |
+
flex_file['STD'] = flex_file['Median'] / 4
|
379 |
+
flex_file['Prop'] = flex_file['Player'].map(prop_dict)
|
380 |
+
flex_file = flex_file[['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD']]
|
381 |
+
|
382 |
+
hold_file = flex_file
|
383 |
+
overall_file = flex_file
|
384 |
+
prop_file = flex_file
|
385 |
+
|
386 |
+
overall_players = overall_file[['Player']]
|
387 |
+
|
388 |
+
for x in range(0,total_sims):
|
389 |
+
prop_file[x] = prop_file['Prop']
|
390 |
+
|
391 |
+
prop_file = prop_file.drop(['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
392 |
+
|
393 |
+
for x in range(0,total_sims):
|
394 |
+
overall_file[x] = np.random.normal(overall_file['Median'],overall_file['STD'])
|
395 |
+
|
396 |
+
overall_file=overall_file.drop(['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
397 |
+
|
398 |
+
players_only = hold_file[['Player']]
|
399 |
+
|
400 |
+
player_outcomes = pd.merge(players_only, overall_file, left_index=True, right_index=True)
|
401 |
+
|
402 |
+
prop_check = (overall_file - prop_file)
|
403 |
+
|
404 |
+
players_only['Mean_Outcome'] = overall_file.mean(axis=1)
|
405 |
+
players_only['10%'] = overall_file.quantile(0.1, axis=1)
|
406 |
+
players_only['90%'] = overall_file.quantile(0.9, axis=1)
|
407 |
+
players_only['Over'] = prop_check[prop_check > 0].count(axis=1)/float(total_sims)
|
408 |
+
players_only['Imp Over'] = players_only['Player'].map(over_dict)
|
409 |
+
players_only['Over%'] = players_only[["Over", "Imp Over"]].mean(axis=1)
|
410 |
+
players_only['Under'] = prop_check[prop_check < 0].count(axis=1)/float(total_sims)
|
411 |
+
players_only['Imp Under'] = players_only['Player'].map(under_dict)
|
412 |
+
players_only['Under%'] = players_only[["Under", "Imp Under"]].mean(axis=1)
|
413 |
+
players_only['Prop'] = players_only['Player'].map(prop_dict)
|
414 |
+
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
415 |
+
players_only['prop_threshold'] = .10
|
416 |
+
players_only = players_only.loc[players_only['Mean_Outcome'] > 0]
|
417 |
+
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
418 |
+
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
419 |
+
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|
420 |
+
players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
|
421 |
+
players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
|
422 |
+
players_only['Edge'] = players_only['Bet_check']
|
423 |
+
players_only['Prop type'] = prop
|
424 |
+
|
425 |
+
players_only['Player'] = hold_file[['Player']]
|
426 |
+
players_only['Team'] = players_only['Player'].map(team_dict)
|
427 |
+
|
428 |
+
leg_outcomes = players_only[['Player', 'Team', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge']]
|
429 |
+
sim_all_hold = pd.concat([sim_all_hold, leg_outcomes], ignore_index=True)
|
430 |
+
|
431 |
+
final_outcomes = sim_all_hold
|
432 |
+
|
433 |
+
elif prop_type_var != 'All Props':
|
434 |
+
|
435 |
+
if prop_type_var == "pass_yards":
|
436 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
437 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'pass_yards']
|
438 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
439 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
440 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
441 |
+
st.table(prop_df)
|
442 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
443 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
444 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
445 |
+
elif prop_type_var == "rush_yards":
|
446 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
447 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'rush_yards']
|
448 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
449 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
450 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
451 |
+
st.table(prop_df)
|
452 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
453 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
454 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
455 |
+
elif prop_type_var == "rec_yards":
|
456 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
457 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'rec_yards']
|
458 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
459 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
460 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
461 |
+
st.table(prop_df)
|
462 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
463 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
464 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
465 |
+
elif prop_type_var == "receptions":
|
466 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
467 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'receptions']
|
468 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
469 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
470 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
471 |
+
st.table(prop_df)
|
472 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
473 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
474 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
475 |
+
elif prop_type_var == "rush_attempts":
|
476 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
477 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'rush_attempts']
|
478 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
479 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
480 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
481 |
+
st.table(prop_df)
|
482 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
483 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
484 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
485 |
+
elif prop_type_var == "pass_attempts":
|
486 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
487 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'pass_attempts']
|
488 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
489 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
490 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
491 |
+
st.table(prop_df)
|
492 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
493 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
494 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
495 |
+
elif prop_type_var == "pass_completions":
|
496 |
+
prop_df = prop_frame[['Player', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
497 |
+
prop_df = prop_df.loc[prop_df['prop_type'] == 'pass_completions']
|
498 |
+
prop_df = prop_df[['Player', 'over_prop', 'over_line', 'under_line']]
|
499 |
+
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
500 |
+
prop_df = prop_df.loc[prop_df['Prop'] != 0]
|
501 |
+
st.table(prop_df)
|
502 |
+
prop_df['Over'] = np.where(prop_df['over_line'] < 0, (-(prop_df['over_line'])/((-(prop_df['over_line']))+101)), 101/(prop_df['over_line']+101))
|
503 |
+
prop_df['Under'] = np.where(prop_df['under_line'] < 0, (-(prop_df['under_line'])/((-(prop_df['under_line']))+101)), 101/(prop_df['under_line']+101))
|
504 |
+
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
505 |
+
|
506 |
+
prop_dict = dict(zip(df.Player, df.Prop))
|
507 |
+
over_dict = dict(zip(df.Player, df.Over))
|
508 |
+
under_dict = dict(zip(df.Player, df.Under))
|
509 |
+
|
510 |
+
total_sims = 1000
|
511 |
+
|
512 |
+
df.replace("", 0, inplace=True)
|
513 |
+
|
514 |
+
if prop_type_var == "pass_yards":
|
515 |
+
df['Median'] = df['pass_yards']
|
516 |
+
elif prop_type_var == "rush_yards":
|
517 |
+
df['Median'] = df['rush_yards']
|
518 |
+
elif prop_type_var == "rec_yards":
|
519 |
+
df['Median'] = df['rec_yards']
|
520 |
+
elif prop_type_var == "receptions":
|
521 |
+
df['Median'] = df['receptions']
|
522 |
+
|
523 |
+
flex_file = df
|
524 |
+
flex_file['Floor'] = flex_file['Median'] * .20
|
525 |
+
flex_file['Ceiling'] = flex_file['Median'] + (flex_file['Median'] * .80)
|
526 |
+
flex_file['STD'] = flex_file['Median'] / 4
|
527 |
+
flex_file['Prop'] = flex_file['Player'].map(prop_dict)
|
528 |
+
flex_file = flex_file[['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD']]
|
529 |
+
|
530 |
+
hold_file = flex_file
|
531 |
+
overall_file = flex_file
|
532 |
+
prop_file = flex_file
|
533 |
+
|
534 |
+
overall_players = overall_file[['Player']]
|
535 |
+
|
536 |
+
for x in range(0,total_sims):
|
537 |
+
prop_file[x] = prop_file['Prop']
|
538 |
+
|
539 |
+
prop_file = prop_file.drop(['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
540 |
+
|
541 |
+
for x in range(0,total_sims):
|
542 |
+
overall_file[x] = np.random.normal(overall_file['Median'],overall_file['STD'])
|
543 |
+
|
544 |
+
overall_file=overall_file.drop(['Player', 'Prop', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1)
|
545 |
+
|
546 |
+
players_only = hold_file[['Player']]
|
547 |
+
|
548 |
+
player_outcomes = pd.merge(players_only, overall_file, left_index=True, right_index=True)
|
549 |
+
|
550 |
+
prop_check = (overall_file - prop_file)
|
551 |
+
|
552 |
+
players_only['Mean_Outcome'] = overall_file.mean(axis=1)
|
553 |
+
players_only['10%'] = overall_file.quantile(0.1, axis=1)
|
554 |
+
players_only['90%'] = overall_file.quantile(0.9, axis=1)
|
555 |
+
players_only['Over'] = prop_check[prop_check > 0].count(axis=1)/float(total_sims)
|
556 |
+
players_only['Imp Over'] = players_only['Player'].map(over_dict)
|
557 |
+
players_only['Over%'] = players_only[["Over", "Imp Over"]].mean(axis=1)
|
558 |
+
players_only['Under'] = prop_check[prop_check < 0].count(axis=1)/float(total_sims)
|
559 |
+
players_only['Imp Under'] = players_only['Player'].map(under_dict)
|
560 |
+
players_only['Under%'] = players_only[["Under", "Imp Under"]].mean(axis=1)
|
561 |
+
players_only['Prop'] = players_only['Player'].map(prop_dict)
|
562 |
+
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
563 |
+
players_only['prop_threshold'] = .10
|
564 |
+
players_only = players_only.loc[players_only['Mean_Outcome'] > 0]
|
565 |
+
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
566 |
+
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
567 |
+
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|
568 |
+
players_only['Bet_suggest'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], "Over" , "Under")
|
569 |
+
players_only['Bet?'] = np.where(players_only['Bet_check'] >= players_only['prop_threshold'], players_only['Bet_suggest'], "No Bet")
|
570 |
+
players_only['Edge'] = players_only['Bet_check']
|
571 |
+
|
572 |
+
players_only['Player'] = hold_file[['Player']]
|
573 |
+
players_only['Team'] = players_only['Player'].map(team_dict)
|
574 |
+
|
575 |
+
final_outcomes = players_only[['Player', 'Team', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge']]
|
576 |
|
577 |
final_outcomes = final_outcomes.sort_values(by='Edge', ascending=False)
|
|
|
|
|
578 |
|
579 |
with df_hold_container:
|
580 |
df_hold_container = st.empty()
|