Multichem commited on
Commit
8d4579c
·
1 Parent(s): 1fa2977

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -7
app.py CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
2
  import numpy as np
3
  import pandas as pd
4
  import gspread
 
5
  st.set_page_config(layout="wide")
6
 
7
  @st.cache_resource
@@ -62,8 +63,7 @@ non_qb_stats = overall_stats.loc[overall_stats['Position'] != 'QB']
62
  team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
63
  t_stamp = f"Last Update: " + str(timestamp) + f" CST"
64
 
65
- all_sim_vars = ['pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts',
66
- 'pass_attempts', 'pass_completions']
67
  sim_all_hold = pd.DataFrame(columns=['Player', 'Team', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge'])
68
 
69
  tab1, tab2, tab3, tab4, tab5 = st.tabs(["Game Betting Model", "QB Projections", "RB/WR/TE Projections", "Player Prop Simulations", "Stat Specific Simulations"])
@@ -316,8 +316,7 @@ with tab5:
316
  export_container = st.empty()
317
 
318
  with col1:
319
- prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts',
320
- 'pass_attempts', 'pass_completions'])
321
 
322
  if st.button('Simulate Prop Category'):
323
  with col2:
@@ -351,7 +350,11 @@ with tab5:
351
  elif prop_type_var == "rec_yards":
352
  df['Median'] = df['rec_yards']
353
  elif prop_type_var == "receptions":
354
- df['Median'] = df['receptions']
 
 
 
 
355
 
356
  flex_file = df
357
  flex_file['Floor'] = flex_file['Median'] * .20
@@ -488,7 +491,7 @@ with tab5:
488
  over_dict = dict(zip(df.Player, df.Over))
489
  under_dict = dict(zip(df.Player, df.Under))
490
 
491
- total_sims = 1000
492
 
493
  df.replace("", 0, inplace=True)
494
 
@@ -499,7 +502,11 @@ with tab5:
499
  elif prop_type_var == "rec_yards":
500
  df['Median'] = df['rec_yards']
501
  elif prop_type_var == "receptions":
502
- df['Median'] = df['receptions']
 
 
 
 
503
 
504
  flex_file = df
505
  flex_file['Floor'] = flex_file['Median'] * .20
 
2
  import numpy as np
3
  import pandas as pd
4
  import gspread
5
+ import plotly_express as px
6
  st.set_page_config(layout="wide")
7
 
8
  @st.cache_resource
 
63
  team_dict = dict(zip(prop_frame['Player'], prop_frame['Team']))
64
  t_stamp = f"Last Update: " + str(timestamp) + f" CST"
65
 
66
+ all_sim_vars = ['pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts']
 
67
  sim_all_hold = pd.DataFrame(columns=['Player', 'Team', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge'])
68
 
69
  tab1, tab2, tab3, tab4, tab5 = st.tabs(["Game Betting Model", "QB Projections", "RB/WR/TE Projections", "Player Prop Simulations", "Stat Specific Simulations"])
 
316
  export_container = st.empty()
317
 
318
  with col1:
319
+ prop_type_var = st.selectbox('Select prop category', options = ['All Props', 'pass_yards', 'rush_yards', 'rec_yards', 'receptions', 'rush_attempts'])
 
320
 
321
  if st.button('Simulate Prop Category'):
322
  with col2:
 
350
  elif prop_type_var == "rec_yards":
351
  df['Median'] = df['rec_yards']
352
  elif prop_type_var == "receptions":
353
+ df['Median'] = df['rec']
354
+ elif prop_type_var == "receptions":
355
+ df['Median'] = df['rec']
356
+ elif prop_type_var == "rush_attempts":
357
+ df['Median'] = df['rush_att']
358
 
359
  flex_file = df
360
  flex_file['Floor'] = flex_file['Median'] * .20
 
491
  over_dict = dict(zip(df.Player, df.Over))
492
  under_dict = dict(zip(df.Player, df.Under))
493
 
494
+ total_sims = 5000
495
 
496
  df.replace("", 0, inplace=True)
497
 
 
502
  elif prop_type_var == "rec_yards":
503
  df['Median'] = df['rec_yards']
504
  elif prop_type_var == "receptions":
505
+ df['Median'] = df['rec']
506
+ elif prop_type_var == "receptions":
507
+ df['Median'] = df['rec']
508
+ elif prop_type_var == "rush_attempts":
509
+ df['Median'] = df['rush_att']
510
 
511
  flex_file = df
512
  flex_file['Floor'] = flex_file['Median'] * .20