Spaces:
Running
Running
James McCool
commited on
Commit
·
ad0272f
1
Parent(s):
0164067
Refactor app.py to replace Google Sheets API data retrieval with MongoDB for 'prop_frame', 'betsheet_frame', and 'pick_frame', while implementing dropna calls to clean data and enhance processing for betting models.
Browse files
app.py
CHANGED
@@ -93,23 +93,23 @@ def init_baselines():
|
|
93 |
raw_display = pd.DataFrame(cursor)
|
94 |
team_frame = raw_display.drop_duplicates(subset='Names')
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
raw_display = pd.DataFrame(
|
99 |
raw_display.replace('', np.nan, inplace=True)
|
100 |
-
prop_frame = raw_display.
|
101 |
|
102 |
sh = gc.open_by_url(master_hold)
|
103 |
worksheet = sh.worksheet('Prop_results')
|
104 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
105 |
raw_display.replace('', np.nan, inplace=True)
|
106 |
-
betsheet_frame = raw_display.
|
107 |
|
108 |
collection = db['Pick6_Trends']
|
109 |
cursor = collection.find()
|
110 |
raw_display = pd.DataFrame(cursor)
|
111 |
raw_display.replace('', np.nan, inplace=True)
|
112 |
-
pick_frame = raw_display.
|
113 |
|
114 |
return pitcher_stats, hitter_stats, team_frame, prop_frame, betsheet_frame, pick_frame
|
115 |
|
|
|
93 |
raw_display = pd.DataFrame(cursor)
|
94 |
team_frame = raw_display.drop_duplicates(subset='Names')
|
95 |
|
96 |
+
collection = db['Prop_Trends']
|
97 |
+
cursor = collection.find()
|
98 |
+
raw_display = pd.DataFrame(cursor)
|
99 |
raw_display.replace('', np.nan, inplace=True)
|
100 |
+
prop_frame = raw_display.dropna(subset='Team')
|
101 |
|
102 |
sh = gc.open_by_url(master_hold)
|
103 |
worksheet = sh.worksheet('Prop_results')
|
104 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
105 |
raw_display.replace('', np.nan, inplace=True)
|
106 |
+
betsheet_frame = raw_display.dropna(subset='proj')
|
107 |
|
108 |
collection = db['Pick6_Trends']
|
109 |
cursor = collection.find()
|
110 |
raw_display = pd.DataFrame(cursor)
|
111 |
raw_display.replace('', np.nan, inplace=True)
|
112 |
+
pick_frame = raw_display.dropna(subset='Player')
|
113 |
|
114 |
return pitcher_stats, hitter_stats, team_frame, prop_frame, betsheet_frame, pick_frame
|
115 |
|