Spaces:
Running
Running
James McCool
commited on
Commit
·
68a8fab
1
Parent(s):
149ddf5
full mongo integration
Browse files
app.py
CHANGED
@@ -97,16 +97,10 @@ def init_baselines():
|
|
97 |
raw_display.replace('#DIV/0!', np.nan, inplace=True)
|
98 |
game_model = raw_display.dropna()
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
worksheet = sh.worksheet('DK_Build_Up')
|
103 |
-
raw_display = pd.DataFrame(worksheet.get_all_records())
|
104 |
-
|
105 |
-
except:
|
106 |
-
sh = gcservice_account2.open_by_url(NBA_Data)
|
107 |
-
worksheet = sh.worksheet('DK_Build_Up')
|
108 |
-
raw_display = pd.DataFrame(worksheet.get_all_records())
|
109 |
|
|
|
110 |
raw_display.replace('', np.nan, inplace=True)
|
111 |
raw_display = raw_display.rename(columns={"Name": "Player"})
|
112 |
raw_baselines = raw_display[['Player', 'Position', 'Team', 'Opp', 'Minutes', 'FGM', 'FGA', 'FG2M', 'FG2A', 'Threes', 'FG3A', 'FTM', 'FTA', 'TRB', 'AST', 'STL', 'BLK', 'TOV', 'PRA', 'PR', 'PA', 'RA']]
|
@@ -125,14 +119,22 @@ def init_baselines():
|
|
125 |
worksheet = sh.worksheet('Timestamp')
|
126 |
timestamp = worksheet.acell('A1').value
|
127 |
|
128 |
-
|
129 |
-
|
|
|
|
|
130 |
raw_display.replace('', np.nan, inplace=True)
|
|
|
|
|
131 |
raw_display = raw_display.rename(columns={"Name": "Player", "OddsType": "book", "PropType": "prop_type"})
|
132 |
prop_frame = raw_display.dropna(subset='Player')
|
133 |
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
136 |
pick_frame = raw_display.drop_duplicates(subset=['Player', 'prop_type'], keep='first')
|
137 |
pick_frame = pick_frame.reset_index(drop=True)
|
138 |
|
|
|
97 |
raw_display.replace('#DIV/0!', np.nan, inplace=True)
|
98 |
game_model = raw_display.dropna()
|
99 |
|
100 |
+
collection = db["Player_Stats"]
|
101 |
+
cursor = collection.find()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
+
raw_display = pd.DataFrame(list(cursor))
|
104 |
raw_display.replace('', np.nan, inplace=True)
|
105 |
raw_display = raw_display.rename(columns={"Name": "Player"})
|
106 |
raw_baselines = raw_display[['Player', 'Position', 'Team', 'Opp', 'Minutes', 'FGM', 'FGA', 'FG2M', 'FG2A', 'Threes', 'FG3A', 'FTM', 'FTA', 'TRB', 'AST', 'STL', 'BLK', 'TOV', 'PRA', 'PR', 'PA', 'RA']]
|
|
|
119 |
worksheet = sh.worksheet('Timestamp')
|
120 |
timestamp = worksheet.acell('A1').value
|
121 |
|
122 |
+
collection = db["Prop_Trends"]
|
123 |
+
cursor = collection.find()
|
124 |
+
|
125 |
+
raw_display = pd.DataFrame(list(cursor))
|
126 |
raw_display.replace('', np.nan, inplace=True)
|
127 |
+
raw_display = raw_display[['Name', 'over_prop', 'over_line', 'under_prop', 'under_line', 'OddsType', 'PropType', 'No Vig', 'Team', 'L5 Success', 'L10_Success', 'L20_success', 'L10 Avg', 'Projection',
|
128 |
+
'Proj Diff', 'Matchup Boost', 'Implied Over', 'Trending Over', 'Over Edge', 'Implied Under', 'Trending Under', 'Under Edge']]
|
129 |
raw_display = raw_display.rename(columns={"Name": "Player", "OddsType": "book", "PropType": "prop_type"})
|
130 |
prop_frame = raw_display.dropna(subset='Player')
|
131 |
|
132 |
+
collection = db["Pick6_Trends"]
|
133 |
+
cursor = collection.find()
|
134 |
+
|
135 |
+
raw_display = pd.DataFrame(list(cursor))
|
136 |
+
raw_display = raw_display[['Player', 'over_prop', 'over_line', 'under_prop', 'under_line', 'book', 'prop_type', 'No Vig', 'Team', 'L5 Success', 'L10_Success', 'L20_success', 'L10 Avg', 'Projection',
|
137 |
+
'Proj Diff', 'Matchup Boost', 'Implied Over', 'Trending Over', 'Over Edge', 'Implied Under', 'Trending Under', 'Under Edge']]
|
138 |
pick_frame = raw_display.drop_duplicates(subset=['Player', 'prop_type'], keep='first')
|
139 |
pick_frame = pick_frame.reset_index(drop=True)
|
140 |
|