Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,8 @@ gc = gspread.service_account_from_dict(credentials)
|
|
| 25 |
|
| 26 |
st.set_page_config(layout="wide")
|
| 27 |
|
|
|
|
|
|
|
| 28 |
@st.cache_resource(ttl = 300)
|
| 29 |
def init_baselines():
|
| 30 |
sh = gc.open_by_url("https://docs.google.com/spreadsheets/d/1T4n3-KC141n2XwhRCqLssuk1nVdHjsBPSdb8Q6LopuY/edit?gid=0#gid=0")
|
|
@@ -43,7 +45,7 @@ def convert_df_to_csv(df):
|
|
| 43 |
tennis_base = init_baselines()
|
| 44 |
|
| 45 |
with st.container():
|
| 46 |
-
st.dataframe(tennis_base.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), height = 1000, use_container_width = True)
|
| 47 |
st.download_button(
|
| 48 |
label="Export Tables",
|
| 49 |
data=convert_df_to_csv(tennis_base),
|
|
|
|
| 25 |
|
| 26 |
st.set_page_config(layout="wide")
|
| 27 |
|
| 28 |
+
american_format = {'ML': '{:.2%}'}
|
| 29 |
+
|
| 30 |
@st.cache_resource(ttl = 300)
|
| 31 |
def init_baselines():
|
| 32 |
sh = gc.open_by_url("https://docs.google.com/spreadsheets/d/1T4n3-KC141n2XwhRCqLssuk1nVdHjsBPSdb8Q6LopuY/edit?gid=0#gid=0")
|
|
|
|
| 45 |
tennis_base = init_baselines()
|
| 46 |
|
| 47 |
with st.container():
|
| 48 |
+
st.dataframe(tennis_base.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(american_format, precision=2), height = 1000, use_container_width = True)
|
| 49 |
st.download_button(
|
| 50 |
label="Export Tables",
|
| 51 |
data=convert_df_to_csv(tennis_base),
|