Spaces:
Running
Running
James McCool commited on
Commit ·
8c58f6d
1
Parent(s): 5731377
Refactor app.py to reintegrate MongoDB data retrieval for Game_Betting_Model, restoring percentage conversions for ML_Value and Spread_Value while commenting out Google Sheets API calls for improved data processing.
Browse files
app.py
CHANGED
|
@@ -88,21 +88,21 @@ def init_baselines():
|
|
| 88 |
hitter_stats['Hits + Runs + RBIs'] = hitter_stats['Hits'] + hitter_stats['Runs'] + hitter_stats['RBIs']
|
| 89 |
hitter_stats = hitter_stats.drop_duplicates(subset='Player')
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
# team_frame = raw_display.drop_duplicates(subset='Names')
|
| 95 |
-
# team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 96 |
-
# team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
| 97 |
-
# team_frame['ML_Value'] = team_frame['ML_Value'].str.replace('%', '').astype('float')/100
|
| 98 |
-
# team_frame['Spread_Value'] = team_frame['Spread_Value'].str.replace('%', '').astype('float')/100
|
| 99 |
-
|
| 100 |
-
sh = gc.open_by_url(master_hold)
|
| 101 |
-
worksheet = sh.worksheet('Game_Betting_Model')
|
| 102 |
-
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 103 |
team_frame = raw_display.drop_duplicates(subset='Names')
|
| 104 |
team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 105 |
team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
sh = gc.open_by_url(master_hold)
|
| 108 |
worksheet = sh.worksheet('prop_frame')
|
|
|
|
| 88 |
hitter_stats['Hits + Runs + RBIs'] = hitter_stats['Hits'] + hitter_stats['Runs'] + hitter_stats['RBIs']
|
| 89 |
hitter_stats = hitter_stats.drop_duplicates(subset='Player')
|
| 90 |
|
| 91 |
+
collection = db['Game_Betting_Model']
|
| 92 |
+
cursor = collection.find()
|
| 93 |
+
raw_display = pd.DataFrame(cursor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
team_frame = raw_display.drop_duplicates(subset='Names')
|
| 95 |
team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 96 |
team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
| 97 |
+
team_frame['ML_Value'] = team_frame['ML_Value'].str.replace('%', '').astype('float')/100
|
| 98 |
+
team_frame['Spread_Value'] = team_frame['Spread_Value'].str.replace('%', '').astype('float')/100
|
| 99 |
+
|
| 100 |
+
# sh = gc.open_by_url(master_hold)
|
| 101 |
+
# worksheet = sh.worksheet('Game_Betting_Model')
|
| 102 |
+
# raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 103 |
+
# team_frame = raw_display.drop_duplicates(subset='Names')
|
| 104 |
+
# team_frame['Win Percentage'] = team_frame['Win Percentage'].str.replace('%', '').astype('float')/100
|
| 105 |
+
# team_frame['Cover Spread Percentage'] = team_frame['Cover Spread Percentage'].str.replace('%', '').astype('float')/100
|
| 106 |
|
| 107 |
sh = gc.open_by_url(master_hold)
|
| 108 |
worksheet = sh.worksheet('prop_frame')
|