Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,8 +25,8 @@ gc = gspread.service_account_from_dict(credentials)
|
|
| 25 |
|
| 26 |
st.set_page_config(layout="wide")
|
| 27 |
|
| 28 |
-
wrong_acro = ['WSH', 'AZ']
|
| 29 |
-
right_acro = ['WAS', 'ARI']
|
| 30 |
|
| 31 |
game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}',
|
| 32 |
'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
|
|
@@ -60,6 +60,15 @@ def set_slate_teams():
|
|
| 60 |
worksheet = sh.worksheet('Site_Info')
|
| 61 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
for checkVar in range(len(wrong_acro)):
|
| 64 |
raw_display['FD Main'] = raw_display['FD Main'].replace(wrong_acro, right_acro)
|
| 65 |
|
|
@@ -77,7 +86,8 @@ def load_team_roo_table(URL):
|
|
| 77 |
worksheet = sh.worksheet('Team_ROO')
|
| 78 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 79 |
raw_display = raw_display[['teams', 'Opp SP', 'Top Score%', '0 Runs', '1 Run', '2 Runs', '3 Runs', '4 Runs', '5 Runs', '6 Runs', '7 Runs', '8 Runs', '9 Runs', '10 Runs']]
|
| 80 |
-
|
|
|
|
| 81 |
return raw_display
|
| 82 |
|
| 83 |
@st.cache_data
|
|
|
|
| 25 |
|
| 26 |
st.set_page_config(layout="wide")
|
| 27 |
|
| 28 |
+
wrong_acro = ['WSH', 'AZ', 'CWS']
|
| 29 |
+
right_acro = ['WAS', 'ARI', 'CHW']
|
| 30 |
|
| 31 |
game_format = {'Win Percentage': '{:.2%}','First Inning Lead Percentage': '{:.2%}',
|
| 32 |
'Fifth Inning Lead Percentage': '{:.2%}', '8+ runs': '{:.2%}', 'DK LevX': '{:.2%}', 'FD LevX': '{:.2%}'}
|
|
|
|
| 60 |
worksheet = sh.worksheet('Site_Info')
|
| 61 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 62 |
|
| 63 |
+
for checkVar in range(len(wrong_acro)):
|
| 64 |
+
raw_display['DK Main'] = raw_display['DK Main'].replace(wrong_acro, right_acro)
|
| 65 |
+
|
| 66 |
+
for checkVar in range(len(wrong_acro)):
|
| 67 |
+
raw_display['DK Secondary'] = raw_display['DK Secondary'].replace(wrong_acro, right_acro)
|
| 68 |
+
|
| 69 |
+
for checkVar in range(len(wrong_acro)):
|
| 70 |
+
raw_display['DK Overall'] = raw_display['DK Overall'].replace(wrong_acro, right_acro)
|
| 71 |
+
|
| 72 |
for checkVar in range(len(wrong_acro)):
|
| 73 |
raw_display['FD Main'] = raw_display['FD Main'].replace(wrong_acro, right_acro)
|
| 74 |
|
|
|
|
| 86 |
worksheet = sh.worksheet('Team_ROO')
|
| 87 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 88 |
raw_display = raw_display[['teams', 'Opp SP', 'Top Score%', '0 Runs', '1 Run', '2 Runs', '3 Runs', '4 Runs', '5 Runs', '6 Runs', '7 Runs', '8 Runs', '9 Runs', '10 Runs']]
|
| 89 |
+
for checkVar in range(len(wrong_acro)):
|
| 90 |
+
raw_display['teams'] = raw_display['teams'].replace(wrong_acro, right_acro)
|
| 91 |
return raw_display
|
| 92 |
|
| 93 |
@st.cache_data
|