Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,12 +64,16 @@ def load_overall_stats():
|
|
| 64 |
raw_display = raw_display.apply(pd.to_numeric, errors='ignore')
|
| 65 |
roo_raw = raw_display.sort_values(by='Median', ascending=False)
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
def convert_df_to_csv(df):
|
| 70 |
return df.to_csv().encode('utf-8')
|
| 71 |
|
| 72 |
-
dk_raw, fd_raw, roo_raw = load_overall_stats()
|
|
|
|
| 73 |
|
| 74 |
tab1, tab2, tab3 = st.tabs(['Uploads and Info', 'Range of Outcomes', 'Custom Range of Outcomes'])
|
| 75 |
|
|
@@ -94,9 +98,11 @@ with tab2:
|
|
| 94 |
col1, col2 = st.columns([1, 9])
|
| 95 |
|
| 96 |
with col1:
|
|
|
|
| 97 |
if st.button("Load/Reset Data", key='reset1'):
|
| 98 |
st.cache_data.clear()
|
| 99 |
dk_raw, fd_raw, roo_raw = load_overall_stats()
|
|
|
|
| 100 |
for key in st.session_state.keys():
|
| 101 |
del st.session_state[key]
|
| 102 |
site_var2 = st.radio("What table would you like to display?", ('Draftkings', 'Fanduel'), key='site_var2')
|
|
@@ -142,9 +148,11 @@ with tab3:
|
|
| 142 |
col1, col2 = st.columns([1, 9])
|
| 143 |
|
| 144 |
with col1:
|
|
|
|
| 145 |
if st.button("Load/Reset Data", key='reset2'):
|
| 146 |
st.cache_data.clear()
|
| 147 |
dk_raw, fd_raw, roo_raw = load_overall_stats()
|
|
|
|
| 148 |
for key in st.session_state.keys():
|
| 149 |
del st.session_state[key]
|
| 150 |
slate_var1 = st.radio("Which data are you loading?", ('Paydirt', 'User'), key='slate_var1')
|
|
|
|
| 64 |
raw_display = raw_display.apply(pd.to_numeric, errors='ignore')
|
| 65 |
roo_raw = raw_display.sort_values(by='Median', ascending=False)
|
| 66 |
|
| 67 |
+
worksheet = sh.worksheet('Timestamp')
|
| 68 |
+
timestamp = worksheet.acell('A1').value
|
| 69 |
+
|
| 70 |
+
return dk_raw, fd_raw, roo_raw, timestamp
|
| 71 |
|
| 72 |
def convert_df_to_csv(df):
|
| 73 |
return df.to_csv().encode('utf-8')
|
| 74 |
|
| 75 |
+
dk_raw, fd_raw, roo_raw, timestamp = load_overall_stats()
|
| 76 |
+
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 77 |
|
| 78 |
tab1, tab2, tab3 = st.tabs(['Uploads and Info', 'Range of Outcomes', 'Custom Range of Outcomes'])
|
| 79 |
|
|
|
|
| 98 |
col1, col2 = st.columns([1, 9])
|
| 99 |
|
| 100 |
with col1:
|
| 101 |
+
st.info(t_stamp)
|
| 102 |
if st.button("Load/Reset Data", key='reset1'):
|
| 103 |
st.cache_data.clear()
|
| 104 |
dk_raw, fd_raw, roo_raw = load_overall_stats()
|
| 105 |
+
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 106 |
for key in st.session_state.keys():
|
| 107 |
del st.session_state[key]
|
| 108 |
site_var2 = st.radio("What table would you like to display?", ('Draftkings', 'Fanduel'), key='site_var2')
|
|
|
|
| 148 |
col1, col2 = st.columns([1, 9])
|
| 149 |
|
| 150 |
with col1:
|
| 151 |
+
st.info(t_stamp)
|
| 152 |
if st.button("Load/Reset Data", key='reset2'):
|
| 153 |
st.cache_data.clear()
|
| 154 |
dk_raw, fd_raw, roo_raw = load_overall_stats()
|
| 155 |
+
t_stamp = f"Last Update: " + str(timestamp) + f" CST"
|
| 156 |
for key in st.session_state.keys():
|
| 157 |
del st.session_state[key]
|
| 158 |
slate_var1 = st.radio("Which data are you loading?", ('Paydirt', 'User'), key='slate_var1')
|