Spaces:
Running
Running
James McCool
commited on
Commit
·
b8b533c
1
Parent(s):
568ebf6
adjusting for no games on slate
Browse files- src/streamlit_app.py +8 -6
src/streamlit_app.py
CHANGED
|
@@ -163,12 +163,14 @@ def init_macro_tables():
|
|
| 163 |
team_combo_frame = pd.DataFrame(team_combo_json)
|
| 164 |
team_combo_frame = team_combo_frame.reset_index(drop=True)
|
| 165 |
team_combo_frame = team_combo_frame.apply(pd.to_numeric, errors='coerce').fillna(team_combo_frame)
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
| 172 |
|
| 173 |
return team_off_frame, team_def_frame, team_combo_frame, team_matchup_frame, dk_main_slate, fd_main_slate
|
| 174 |
|
|
|
|
| 163 |
team_combo_frame = pd.DataFrame(team_combo_json)
|
| 164 |
team_combo_frame = team_combo_frame.reset_index(drop=True)
|
| 165 |
team_combo_frame = team_combo_frame.apply(pd.to_numeric, errors='coerce').fillna(team_combo_frame)
|
| 166 |
+
try:
|
| 167 |
+
team_matchup_json = requests.get(NBA_DATA + '?sheet=Team%20Matchups').json()
|
| 168 |
+
team_matchup_frame = pd.DataFrame(team_matchup_json)
|
| 169 |
+
team_matchup_frame = team_matchup_frame[team_matchup_frame['t_Pts'] != ""]
|
| 170 |
+
team_matchup_frame = team_matchup_frame.reset_index(drop=True)
|
| 171 |
+
team_matchup_frame = team_matchup_frame.apply(pd.to_numeric, errors='coerce').fillna(team_matchup_frame)
|
| 172 |
+
except:
|
| 173 |
+
team_matchup_frame = pd.DataFrame()
|
| 174 |
|
| 175 |
return team_off_frame, team_def_frame, team_combo_frame, team_matchup_frame, dk_main_slate, fd_main_slate
|
| 176 |
|