Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,6 +31,8 @@ odds_format = {'Odds': '{:.2%}'}
|
|
| 31 |
|
| 32 |
stat_format = {'Odds%': '{:.2%}'}
|
| 33 |
|
|
|
|
|
|
|
| 34 |
master_hold = 'https://docs.google.com/spreadsheets/d/1dOXsbeWbvWjRyohsEEDXOiWji4-1R1J6E-Lu2CSM9AM/edit#gid=928272897'
|
| 35 |
|
| 36 |
@st.cache_resource(ttl=600)
|
|
@@ -58,6 +60,8 @@ def pull_baselines():
|
|
| 58 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 59 |
raw_display = raw_display.loc[raw_display['Player'] != ""]
|
| 60 |
map_proj_3 = raw_display[['Player', 'Team', 'Opponent', 'Odds', 'Win%', 'Avg Kills', 'Avg Deaths', 'Proj_Kills', 'Proj_Deaths']]
|
|
|
|
|
|
|
| 61 |
|
| 62 |
worksheet = sh.worksheet('Timestamp')
|
| 63 |
timestamp = worksheet.acell('A1').value
|
|
@@ -126,7 +130,7 @@ with tab3:
|
|
| 126 |
map_stat_display = map_proj_3
|
| 127 |
if team_var2:
|
| 128 |
map_stat_display = map_stat_display[display['Team'].isin(team_var2)]
|
| 129 |
-
st.dataframe(map_stat_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(
|
| 130 |
st.download_button(
|
| 131 |
label="Export Projections",
|
| 132 |
data=convert_df_to_csv(map_stat_display),
|
|
|
|
| 31 |
|
| 32 |
stat_format = {'Odds%': '{:.2%}'}
|
| 33 |
|
| 34 |
+
map_proj_format = {'Win%': '{:.2%}'}
|
| 35 |
+
|
| 36 |
master_hold = 'https://docs.google.com/spreadsheets/d/1dOXsbeWbvWjRyohsEEDXOiWji4-1R1J6E-Lu2CSM9AM/edit#gid=928272897'
|
| 37 |
|
| 38 |
@st.cache_resource(ttl=600)
|
|
|
|
| 60 |
raw_display = pd.DataFrame(worksheet.get_all_records())
|
| 61 |
raw_display = raw_display.loc[raw_display['Player'] != ""]
|
| 62 |
map_proj_3 = raw_display[['Player', 'Team', 'Opponent', 'Odds', 'Win%', 'Avg Kills', 'Avg Deaths', 'Proj_Kills', 'Proj_Deaths']]
|
| 63 |
+
data_cols = map_proj_3.columns.drop(['Player', 'Team', 'Opponent', 'Win%'])
|
| 64 |
+
map_proj_3[data_cols] = map_proj_3[data_cols].apply(pd.to_numeric, errors='coerce')
|
| 65 |
|
| 66 |
worksheet = sh.worksheet('Timestamp')
|
| 67 |
timestamp = worksheet.acell('A1').value
|
|
|
|
| 130 |
map_stat_display = map_proj_3
|
| 131 |
if team_var2:
|
| 132 |
map_stat_display = map_stat_display[display['Team'].isin(team_var2)]
|
| 133 |
+
st.dataframe(map_stat_display.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(map_proj_format, precision=2), use_container_width = True)
|
| 134 |
st.download_button(
|
| 135 |
label="Export Projections",
|
| 136 |
data=convert_df_to_csv(map_stat_display),
|