James McCool commited on
Commit
3bccd59
·
1 Parent(s): 9157685

Update query keys in app.py to use consistent casing for 'Site' and 'Slate' across Draftkings and Fanduel queries.

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -58,7 +58,7 @@ def init_DK_seed_frames(sharp_split):
58
 
59
  # Get the valid players from the Range of Outcomes collection
60
  collection = db["Player_Range_Of_Outcomes"]
61
- cursor = collection.find({"site": "Draftkings", "slate": "Main Slate"})
62
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
63
 
64
  collection = db["DK_MLB_seed_frame"]
@@ -89,7 +89,7 @@ def init_DK_secondary_seed_frames(sharp_split):
89
 
90
  # Get the valid players from the Range of Outcomes collection
91
  collection = db["Player_Range_Of_Outcomes"]
92
- cursor = collection.find({"site": "Draftkings", "slate": "Secondary Slate"})
93
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
94
 
95
  collection = db["DK_MLB_secondary_seed_frame"]
@@ -120,7 +120,7 @@ def init_FD_seed_frames(sharp_split):
120
 
121
  # Get the valid players from the Range of Outcomes collection
122
  collection = db["Player_Range_Of_Outcomes"]
123
- cursor = collection.find({"site": "Fanduel", "slate": "Main Slate"})
124
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
125
 
126
  collection = db["FD_MLB_seed_frame"]
@@ -151,7 +151,7 @@ def init_FD_secondary_seed_frames(sharp_split):
151
 
152
  # Get the valid players from the Range of Outcomes collection
153
  collection = db["Player_Range_Of_Outcomes"]
154
- cursor = collection.find({"site": "Fanduel", "slate": "Secondary Slate"})
155
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
156
 
157
  collection = db["FD_MLB_secondary_seed_frame"]
@@ -183,23 +183,23 @@ def init_baselines():
183
  load_display.rename(columns={"Fantasy": "Median", 'Name': 'Player', 'player_ID': 'player_id'}, inplace = True)
184
  load_display = load_display[load_display['Median'] > 0]
185
 
186
- dk_roo_raw = load_display[load_display['site'] == 'Draftkings']
187
- dk_roo_raw = dk_roo_raw[dk_roo_raw['slate'] == 'Main Slate']
188
  dk_roo_raw['STDev'] = dk_roo_raw['Median'] / 3
189
  dk_raw = dk_roo_raw.dropna(subset=['Median'])
190
 
191
- fd_roo_raw = load_display[load_display['site'] == 'Fanduel']
192
- fd_roo_raw = fd_roo_raw[fd_roo_raw['slate'] == 'Main Slate']
193
  fd_roo_raw['STDev'] = fd_roo_raw['Median'] / 3
194
  fd_raw = fd_roo_raw.dropna(subset=['Median'])
195
 
196
- dk_secondary_roo_raw = load_display[load_display['site'] == 'Draftkings']
197
- dk_secondary_roo_raw = dk_secondary_roo_raw[dk_secondary_roo_raw['slate'] == 'Secondary Slate']
198
  dk_secondary_roo_raw['STDev'] = dk_secondary_roo_raw['Median'] / 3
199
  dk_secondary = dk_secondary_roo_raw.dropna(subset=['Median'])
200
 
201
- fd_secondary_roo_raw = load_display[load_display['site'] == 'Fanduel']
202
- fd_secondary_roo_raw = fd_secondary_roo_raw[fd_secondary_roo_raw['slate'] == 'Secondary Slate']
203
  fd_secondary_roo_raw['STDev'] = fd_secondary_roo_raw['Median'] / 3
204
  fd_secondary = fd_secondary_roo_raw.dropna(subset=['Median'])
205
 
 
58
 
59
  # Get the valid players from the Range of Outcomes collection
60
  collection = db["Player_Range_Of_Outcomes"]
61
+ cursor = collection.find({"Site": "Draftkings", "Slate": "Main Slate"})
62
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
63
 
64
  collection = db["DK_MLB_seed_frame"]
 
89
 
90
  # Get the valid players from the Range of Outcomes collection
91
  collection = db["Player_Range_Of_Outcomes"]
92
+ cursor = collection.find({"Site": "Draftkings", "Slate": "Secondary Slate"})
93
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
94
 
95
  collection = db["DK_MLB_secondary_seed_frame"]
 
120
 
121
  # Get the valid players from the Range of Outcomes collection
122
  collection = db["Player_Range_Of_Outcomes"]
123
+ cursor = collection.find({"Site": "Fanduel", "Slate": "Main Slate"})
124
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
125
 
126
  collection = db["FD_MLB_seed_frame"]
 
151
 
152
  # Get the valid players from the Range of Outcomes collection
153
  collection = db["Player_Range_Of_Outcomes"]
154
+ cursor = collection.find({"Site": "Fanduel", "Slate": "Secondary Slate"})
155
  valid_players = set(pd.DataFrame(list(cursor))['Player'].unique())
156
 
157
  collection = db["FD_MLB_secondary_seed_frame"]
 
183
  load_display.rename(columns={"Fantasy": "Median", 'Name': 'Player', 'player_ID': 'player_id'}, inplace = True)
184
  load_display = load_display[load_display['Median'] > 0]
185
 
186
+ dk_roo_raw = load_display[load_display['Site'] == 'Draftkings']
187
+ dk_roo_raw = dk_roo_raw[dk_roo_raw['Slate'] == 'Main Slate']
188
  dk_roo_raw['STDev'] = dk_roo_raw['Median'] / 3
189
  dk_raw = dk_roo_raw.dropna(subset=['Median'])
190
 
191
+ fd_roo_raw = load_display[load_display['Site'] == 'Fanduel']
192
+ fd_roo_raw = fd_roo_raw[fd_roo_raw['Slate'] == 'Main Slate']
193
  fd_roo_raw['STDev'] = fd_roo_raw['Median'] / 3
194
  fd_raw = fd_roo_raw.dropna(subset=['Median'])
195
 
196
+ dk_secondary_roo_raw = load_display[load_display['Site'] == 'Draftkings']
197
+ dk_secondary_roo_raw = dk_secondary_roo_raw[dk_secondary_roo_raw['Slate'] == 'Secondary Slate']
198
  dk_secondary_roo_raw['STDev'] = dk_secondary_roo_raw['Median'] / 3
199
  dk_secondary = dk_secondary_roo_raw.dropna(subset=['Median'])
200
 
201
+ fd_secondary_roo_raw = load_display[load_display['Site'] == 'Fanduel']
202
+ fd_secondary_roo_raw = fd_secondary_roo_raw[fd_secondary_roo_raw['Slate'] == 'Secondary Slate']
203
  fd_secondary_roo_raw['STDev'] = fd_secondary_roo_raw['Median'] / 3
204
  fd_secondary = fd_secondary_roo_raw.dropna(subset=['Median'])
205