Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -117,19 +117,24 @@ def init_baselines():
|
|
117 |
|
118 |
export_dem = overall_dem[['Team', 'Acro', 'G', 'Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost',
|
119 |
'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM', 'FPPM Boost', 'Team FPPM Boost', 'position']]
|
|
|
|
|
|
|
120 |
|
121 |
-
return export_dem, matchups, matchups_dict
|
122 |
|
123 |
def convert_df_to_csv(df):
|
124 |
return df.to_csv().encode('utf-8')
|
125 |
|
126 |
-
overall_dem, matchups, matchups_dict = init_baselines()
|
|
|
127 |
|
128 |
col1, col2 = st.columns([1, 9])
|
|
|
129 |
with col1:
|
130 |
if st.button("Reset Data", key='reset1'):
|
131 |
st.cache_data.clear()
|
132 |
-
overall_dem, matchups, matchups_dict = init_baselines()
|
133 |
split_var1 = st.radio("View all teams or just this main slate's matchups?", ('Slate Matchups', 'All'), key='split_var1')
|
134 |
if split_var1 == 'Slate Matchups':
|
135 |
view_var1 = matchups.Opp.values.tolist()
|
|
|
117 |
|
118 |
export_dem = overall_dem[['Team', 'Acro', 'G', 'Pts% Boost', 'Reb% Boost', 'Ast% Boost', '3p% Boost',
|
119 |
'Stl Boost%', 'Blk Boost%', 'TOV Boost%', 'FPPM', 'FPPM Boost', 'Team FPPM Boost', 'position']]
|
120 |
+
|
121 |
+
worksheet = sh.worksheet('DEM Matchups')
|
122 |
+
timestamp = worksheet.acell('F1').value
|
123 |
|
124 |
+
return export_dem, matchups, matchups_dict, timestamp
|
125 |
|
126 |
def convert_df_to_csv(df):
|
127 |
return df.to_csv().encode('utf-8')
|
128 |
|
129 |
+
overall_dem, matchups, matchups_dict, timestamp = init_baselines()
|
130 |
+
t_stamp = f"Updated through: " + str(timestamp) + f" CST"
|
131 |
|
132 |
col1, col2 = st.columns([1, 9])
|
133 |
+
st.info(t_stamp)
|
134 |
with col1:
|
135 |
if st.button("Reset Data", key='reset1'):
|
136 |
st.cache_data.clear()
|
137 |
+
overall_dem, matchups, matchups_dict, t_stamp = init_baselines()
|
138 |
split_var1 = st.radio("View all teams or just this main slate's matchups?", ('Slate Matchups', 'All'), key='split_var1')
|
139 |
if split_var1 == 'Slate Matchups':
|
140 |
view_var1 = matchups.Opp.values.tolist()
|