James McCool commited on
Commit
62b58db
·
1 Parent(s): bd7be98

added O/U, added some sorting and replacing of null values

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -28,7 +28,10 @@ def init_baselines():
28
  collection = dfs_db["NCAAF_GameModel"]
29
  cursor = collection.find()
30
  raw_display = pd.DataFrame(list(cursor))
31
- game_model = raw_display[['Team', 'Opp', 'Win%', 'Vegas', 'Win% Diff', 'Win Line', 'Vegas Line', 'Line Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff']]
 
 
 
32
 
33
  collection = props_db["NCAAF_Props"]
34
  cursor = collection.find()
@@ -69,6 +72,8 @@ prop_table_options = ['NCAAF_GAME_PLAYER_PASSING_YARDS', 'NCAAF_GAME_PLAYER_RUSH
69
  prop_format = {'L3 Success': '{:.2%}', 'L6_Success': '{:.2%}', 'L10_success': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
70
  'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
71
 
 
 
72
  tab1, tab2 = st.tabs(["Game Model", "Prop Market"])
73
 
74
  with tab1:
 
28
  collection = dfs_db["NCAAF_GameModel"]
29
  cursor = collection.find()
30
  raw_display = pd.DataFrame(list(cursor))
31
+ game_model = raw_display[['Team', 'Opp', 'Win%', 'Vegas', 'Win% Diff', 'Win Line', 'Vegas Line', 'Line Diff', 'PD Spread', 'Vegas Spread', 'Spread Diff', 'O/U']]
32
+ game_model = game_model.replace('', np.nan)
33
+ game_model = game_model.sort_values(by='O/U', ascending=False)
34
+ game_model.loc[:, ~game_model.columns.isin(['Team', 'Opp'])] = game_model.loc[:, ~game_model.columns.isin(['Team', 'Opp'])].apply(pd.to_numeric)
35
 
36
  collection = props_db["NCAAF_Props"]
37
  cursor = collection.find()
 
72
  prop_format = {'L3 Success': '{:.2%}', 'L6_Success': '{:.2%}', 'L10_success': '{:.2%}', 'Trending Over': '{:.2%}', 'Trending Under': '{:.2%}',
73
  'Implied Over': '{:.2%}', 'Implied Under': '{:.2%}', 'Over Edge': '{:.2%}', 'Under Edge': '{:.2%}'}
74
 
75
+ game_model, market_props = init_baselines()
76
+
77
  tab1, tab2 = st.tabs(["Game Model", "Prop Market"])
78
 
79
  with tab1: