Spaces:
Running
Running
James McCool
commited on
Commit
·
4c34346
1
Parent(s):
83b0a3d
Removed .loc and Full_name
Browse files
app.py
CHANGED
@@ -82,8 +82,8 @@ def init_baselines():
|
|
82 |
return game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame
|
83 |
|
84 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
85 |
-
qb_stats = overall_stats
|
86 |
-
non_qb_stats = overall_stats
|
87 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
88 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
89 |
|
@@ -106,8 +106,8 @@ with tab1:
|
|
106 |
if st.button("Reset Data", key='reset1'):
|
107 |
st.cache_data.clear()
|
108 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
109 |
-
qb_stats = overall_stats
|
110 |
-
non_qb_stats = overall_stats
|
111 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
112 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
113 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
@@ -137,8 +137,8 @@ with tab2:
|
|
137 |
if st.button("Reset Data", key='reset2'):
|
138 |
st.cache_data.clear()
|
139 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
140 |
-
qb_stats = overall_stats
|
141 |
-
non_qb_stats = overall_stats
|
142 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
143 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
144 |
split_var1 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var1')
|
@@ -163,8 +163,8 @@ with tab3:
|
|
163 |
if st.button("Reset Data", key='reset3'):
|
164 |
st.cache_data.clear()
|
165 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
166 |
-
qb_stats = overall_stats
|
167 |
-
non_qb_stats = overall_stats
|
168 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
169 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
170 |
split_var2 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var2')
|
@@ -189,8 +189,8 @@ with tab4:
|
|
189 |
if st.button("Reset Data", key='reset4'):
|
190 |
st.cache_data.clear()
|
191 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
192 |
-
qb_stats = overall_stats
|
193 |
-
non_qb_stats = overall_stats
|
194 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
195 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
196 |
split_var5 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var5')
|
@@ -218,8 +218,8 @@ with tab5:
|
|
218 |
if st.button("Reset Data", key='reset5'):
|
219 |
st.cache_data.clear()
|
220 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
221 |
-
qb_stats = overall_stats
|
222 |
-
non_qb_stats = overall_stats
|
223 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
224 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
225 |
col1, col2 = st.columns([1, 5])
|
@@ -268,7 +268,7 @@ with tab5:
|
|
268 |
|
269 |
df.replace("", 0, inplace=True)
|
270 |
|
271 |
-
player_var = df
|
272 |
player_var = player_var.reset_index()
|
273 |
|
274 |
if prop_type_var == 'Pass Yards':
|
@@ -328,8 +328,8 @@ with tab5:
|
|
328 |
|
329 |
final_outcomes = players_only[['Player', '10%', 'Mean_Outcome', '90%', 'implied_odds', 'beat_prop']]
|
330 |
final_outcomes['Bet?'] = np.where(final_outcomes['beat_prop'] - final_outcomes['implied_odds'] >= .10, "Bet", "No Bet")
|
331 |
-
final_outcomes = final_outcomes
|
332 |
-
player_outcomes = player_outcomes
|
333 |
player_outcomes = player_outcomes.drop(columns=['Player']).transpose()
|
334 |
player_outcomes = player_outcomes.reset_index()
|
335 |
player_outcomes.columns = ['Instance', 'Outcome']
|
@@ -365,8 +365,8 @@ with tab6:
|
|
365 |
if st.button("Reset Data/Load Data", key='reset6'):
|
366 |
st.cache_data.clear()
|
367 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
368 |
-
qb_stats = overall_stats
|
369 |
-
non_qb_stats = overall_stats
|
370 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
371 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
372 |
col1, col2 = st.columns([1, 5])
|
@@ -387,8 +387,7 @@ with tab6:
|
|
387 |
if game_select_var == 'Aggregate':
|
388 |
prop_df = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
389 |
elif game_select_var == 'Pick6':
|
390 |
-
prop_df = pick_frame[['
|
391 |
-
prop_df.rename(columns={"Full_name": "Player"}, inplace = True)
|
392 |
book_selections = ['Pick6']
|
393 |
st.download_button(
|
394 |
label="Download Prop Source",
|
@@ -418,17 +417,16 @@ with tab6:
|
|
418 |
if game_select_var == 'Aggregate':
|
419 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
420 |
elif game_select_var == 'Pick6':
|
421 |
-
prop_df_raw = pick_frame[['
|
422 |
-
prop_df_raw.rename(columns={"Full_name": "Player"}, inplace = True)
|
423 |
|
424 |
for books in book_selections:
|
425 |
-
prop_df = prop_df_raw
|
426 |
-
prop_df = prop_df
|
427 |
prop_df = prop_df[~((prop_df['over_prop'] < 15) & (prop_df['prop_type'] == 'NFL_GAME_PLAYER_RUSHING_YARDS'))]
|
428 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
|
429 |
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
430 |
prop_df = prop_df.drop_duplicates(subset=['Player'])
|
431 |
-
prop_df = prop_df
|
432 |
prop_df['Over'] = 1 / prop_df['over_line']
|
433 |
prop_df['Under'] = 1 / prop_df['under_line']
|
434 |
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
@@ -507,7 +505,7 @@ with tab6:
|
|
507 |
players_only['Book'] = players_only['Player'].map(book_dict)
|
508 |
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
509 |
players_only['prop_threshold'] = .10
|
510 |
-
players_only = players_only
|
511 |
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
512 |
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
513 |
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|
@@ -529,52 +527,51 @@ with tab6:
|
|
529 |
if game_select_var == 'Aggregate':
|
530 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
531 |
elif game_select_var == 'Pick6':
|
532 |
-
prop_df_raw = pick_frame[['
|
533 |
-
prop_df_raw.rename(columns={"Full_name": "Player"}, inplace = True)
|
534 |
|
535 |
for books in book_selections:
|
536 |
-
prop_df = prop_df_raw
|
537 |
|
538 |
if prop_type_var == "NFL_GAME_PLAYER_PASSING_YARDS":
|
539 |
-
prop_df = prop_df
|
540 |
elif prop_type_var == "Passing Yards":
|
541 |
-
prop_df = prop_df
|
542 |
elif prop_type_var == "NFL_GAME_PLAYER_RUSHING_YARDS":
|
543 |
-
prop_df = prop_df
|
544 |
elif prop_type_var == "Rushing Yards":
|
545 |
-
prop_df = prop_df
|
546 |
elif prop_type_var == "NFL_GAME_PLAYER_PASSING_ATTEMPTS":
|
547 |
-
prop_df = prop_df
|
548 |
elif prop_type_var == "Passing Attempts":
|
549 |
-
prop_df = prop_df
|
550 |
elif prop_type_var == "NFL_GAME_PLAYER_PASSING_TOUCHDOWNS":
|
551 |
-
prop_df = prop_df
|
552 |
elif prop_type_var == "Passing TDs":
|
553 |
-
prop_df = prop_df
|
554 |
elif prop_type_var == "NFL_GAME_PLAYER_RUSHING_ATTEMPTS":
|
555 |
-
prop_df = prop_df
|
556 |
elif prop_type_var == "Rushing Attempts":
|
557 |
-
prop_df = prop_df
|
558 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_RECEPTIONS":
|
559 |
-
prop_df = prop_df
|
560 |
elif prop_type_var == "Receptions":
|
561 |
-
prop_df = prop_df
|
562 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_YARDS":
|
563 |
-
prop_df = prop_df
|
564 |
elif prop_type_var == "Receiving Yards":
|
565 |
-
prop_df = prop_df
|
566 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_TOUCHDOWNS":
|
567 |
-
prop_df = prop_df
|
568 |
elif prop_type_var == "Receiving TDs":
|
569 |
-
prop_df = prop_df
|
570 |
elif prop_type_var == "Rush + Rec Yards":
|
571 |
-
prop_df = prop_df
|
572 |
elif prop_type_var == "Rush + Rec TDs":
|
573 |
-
prop_df = prop_df
|
574 |
|
575 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
|
576 |
prop_df = prop_df.rename(columns={"over_prop": "Prop"})
|
577 |
-
prop_df = prop_df
|
578 |
prop_df = prop_df.drop_duplicates(subset=['Player'])
|
579 |
prop_df['Over'] = 1 / prop_df['over_line']
|
580 |
prop_df['Under'] = 1 / prop_df['under_line']
|
@@ -654,7 +651,7 @@ with tab6:
|
|
654 |
players_only['Prop'] = players_only['Player'].map(prop_dict)
|
655 |
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
656 |
players_only['prop_threshold'] = .10
|
657 |
-
players_only = players_only
|
658 |
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
659 |
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
660 |
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|
|
|
82 |
return game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame
|
83 |
|
84 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
85 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
86 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
87 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
88 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
89 |
|
|
|
106 |
if st.button("Reset Data", key='reset1'):
|
107 |
st.cache_data.clear()
|
108 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
109 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
110 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
111 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
112 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
113 |
line_var1 = st.radio('How would you like to display odds?', options = ['Percentage', 'American'], key='line_var1')
|
|
|
137 |
if st.button("Reset Data", key='reset2'):
|
138 |
st.cache_data.clear()
|
139 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
140 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
141 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
142 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
143 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
144 |
split_var1 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var1')
|
|
|
163 |
if st.button("Reset Data", key='reset3'):
|
164 |
st.cache_data.clear()
|
165 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
166 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
167 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
168 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
169 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
170 |
split_var2 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var2')
|
|
|
189 |
if st.button("Reset Data", key='reset4'):
|
190 |
st.cache_data.clear()
|
191 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
192 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
193 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
194 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
195 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
196 |
split_var5 = st.radio("Would you like to view all teams or specific ones?", ('All', 'Specific Teams'), key='split_var5')
|
|
|
218 |
if st.button("Reset Data", key='reset5'):
|
219 |
st.cache_data.clear()
|
220 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
221 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
222 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
223 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
224 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
225 |
col1, col2 = st.columns([1, 5])
|
|
|
268 |
|
269 |
df.replace("", 0, inplace=True)
|
270 |
|
271 |
+
player_var = df[df['Player'] == player_check]
|
272 |
player_var = player_var.reset_index()
|
273 |
|
274 |
if prop_type_var == 'Pass Yards':
|
|
|
328 |
|
329 |
final_outcomes = players_only[['Player', '10%', 'Mean_Outcome', '90%', 'implied_odds', 'beat_prop']]
|
330 |
final_outcomes['Bet?'] = np.where(final_outcomes['beat_prop'] - final_outcomes['implied_odds'] >= .10, "Bet", "No Bet")
|
331 |
+
final_outcomes = final_outcomes[final_outcomes['Player'] == player_check]
|
332 |
+
player_outcomes = player_outcomes[player_outcomes['Player'] == player_check]
|
333 |
player_outcomes = player_outcomes.drop(columns=['Player']).transpose()
|
334 |
player_outcomes = player_outcomes.reset_index()
|
335 |
player_outcomes.columns = ['Instance', 'Outcome']
|
|
|
365 |
if st.button("Reset Data/Load Data", key='reset6'):
|
366 |
st.cache_data.clear()
|
367 |
game_model, overall_stats, timestamp, prop_frame, prop_trends, pick_frame = init_baselines()
|
368 |
+
qb_stats = overall_stats[overall_stats['Position'] == 'QB']
|
369 |
+
non_qb_stats = overall_stats[overall_stats['Position'] != 'QB']
|
370 |
team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
|
371 |
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
372 |
col1, col2 = st.columns([1, 5])
|
|
|
387 |
if game_select_var == 'Aggregate':
|
388 |
prop_df = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
389 |
elif game_select_var == 'Pick6':
|
390 |
+
prop_df = pick_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
|
|
391 |
book_selections = ['Pick6']
|
392 |
st.download_button(
|
393 |
label="Download Prop Source",
|
|
|
417 |
if game_select_var == 'Aggregate':
|
418 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
419 |
elif game_select_var == 'Pick6':
|
420 |
+
prop_df_raw = pick_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
|
|
421 |
|
422 |
for books in book_selections:
|
423 |
+
prop_df = prop_df_raw[prop_df_raw['book'] == books]
|
424 |
+
prop_df = prop_df[prop_df['prop_type'] == prop]
|
425 |
prop_df = prop_df[~((prop_df['over_prop'] < 15) & (prop_df['prop_type'] == 'NFL_GAME_PLAYER_RUSHING_YARDS'))]
|
426 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
|
427 |
prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
|
428 |
prop_df = prop_df.drop_duplicates(subset=['Player'])
|
429 |
+
prop_df = prop_df[prop_df['Prop'] != 0]
|
430 |
prop_df['Over'] = 1 / prop_df['over_line']
|
431 |
prop_df['Under'] = 1 / prop_df['under_line']
|
432 |
df = pd.merge(overall_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
|
|
|
505 |
players_only['Book'] = players_only['Player'].map(book_dict)
|
506 |
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
507 |
players_only['prop_threshold'] = .10
|
508 |
+
players_only = players_only[players_only['Mean_Outcome'] > 0]
|
509 |
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
510 |
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
511 |
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|
|
|
527 |
if game_select_var == 'Aggregate':
|
528 |
prop_df_raw = prop_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
529 |
elif game_select_var == 'Pick6':
|
530 |
+
prop_df_raw = pick_frame[['Player', 'book', 'over_prop', 'over_line', 'under_line', 'prop_type']]
|
|
|
531 |
|
532 |
for books in book_selections:
|
533 |
+
prop_df = prop_df_raw[prop_df_raw['book'] == books]
|
534 |
|
535 |
if prop_type_var == "NFL_GAME_PLAYER_PASSING_YARDS":
|
536 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_PASSING_YARDS']
|
537 |
elif prop_type_var == "Passing Yards":
|
538 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Passing Yards']
|
539 |
elif prop_type_var == "NFL_GAME_PLAYER_RUSHING_YARDS":
|
540 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_RUSHING_YARDS']
|
541 |
elif prop_type_var == "Rushing Yards":
|
542 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Rushing Yards']
|
543 |
elif prop_type_var == "NFL_GAME_PLAYER_PASSING_ATTEMPTS":
|
544 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_PASSING_ATTEMPTS']
|
545 |
elif prop_type_var == "Passing Attempts":
|
546 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Passing Attempts']
|
547 |
elif prop_type_var == "NFL_GAME_PLAYER_PASSING_TOUCHDOWNS":
|
548 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_PASSING_TOUCHDOWNS']
|
549 |
elif prop_type_var == "Passing TDs":
|
550 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Passing TDs']
|
551 |
elif prop_type_var == "NFL_GAME_PLAYER_RUSHING_ATTEMPTS":
|
552 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_RUSHING_ATTEMPTS']
|
553 |
elif prop_type_var == "Rushing Attempts":
|
554 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Rushing Attempts']
|
555 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_RECEPTIONS":
|
556 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_RECEIVING_RECEPTIONS']
|
557 |
elif prop_type_var == "Receptions":
|
558 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Receptions']
|
559 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_YARDS":
|
560 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_RECEIVING_YARDS']
|
561 |
elif prop_type_var == "Receiving Yards":
|
562 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Receiving Yards']
|
563 |
elif prop_type_var == "NFL_GAME_PLAYER_RECEIVING_TOUCHDOWNS":
|
564 |
+
prop_df = prop_df[prop_df['prop_type'] == 'NFL_GAME_PLAYER_RECEIVING_TOUCHDOWNS']
|
565 |
elif prop_type_var == "Receiving TDs":
|
566 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Receiving TDs']
|
567 |
elif prop_type_var == "Rush + Rec Yards":
|
568 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Rush + Rec Yards']
|
569 |
elif prop_type_var == "Rush + Rec TDs":
|
570 |
+
prop_df = prop_df[prop_df['prop_type'] == 'Rush + Rec TDs']
|
571 |
|
572 |
prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
|
573 |
prop_df = prop_df.rename(columns={"over_prop": "Prop"})
|
574 |
+
prop_df = prop_df[prop_df['Prop'] != 0]
|
575 |
prop_df = prop_df.drop_duplicates(subset=['Player'])
|
576 |
prop_df['Over'] = 1 / prop_df['over_line']
|
577 |
prop_df['Under'] = 1 / prop_df['under_line']
|
|
|
651 |
players_only['Prop'] = players_only['Player'].map(prop_dict)
|
652 |
players_only['Prop_avg'] = players_only['Prop'].mean() / 100
|
653 |
players_only['prop_threshold'] = .10
|
654 |
+
players_only = players_only[players_only['Mean_Outcome'] > 0]
|
655 |
players_only['Over_diff'] = players_only['Over%'] - players_only['Imp Over']
|
656 |
players_only['Under_diff'] = players_only['Under%'] - players_only['Imp Under']
|
657 |
players_only['Bet_check'] = np.where(players_only['Over_diff'] > players_only['Under_diff'], players_only['Over_diff'] , players_only['Under_diff'])
|