Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,9 @@ def init_baselines():
|
|
94 |
rot_table[data_cols] = rot_table[data_cols].apply(pd.to_numeric, errors='coerce')
|
95 |
rot_table = rot_table[rot_table['Player'] != 0]
|
96 |
|
97 |
-
|
|
|
|
|
98 |
|
99 |
@st.cache_data(show_spinner=False)
|
100 |
def seasonlong_build(data_sample):
|
@@ -195,7 +197,8 @@ def split_frame(input_df, rows):
|
|
195 |
def convert_df_to_csv(df):
|
196 |
return df.to_csv().encode('utf-8')
|
197 |
|
198 |
-
gamelog_table, rot_table = init_baselines()
|
|
|
199 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
200 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
201 |
data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
@@ -217,6 +220,7 @@ total_dates = gamelog_table.Date.values.tolist()
|
|
217 |
tab1, tab2, tab3, tab4 = st.tabs(['Gamelogs', 'Correlation Matrix', 'Position vs. Opp', 'Rotations'])
|
218 |
|
219 |
with tab1:
|
|
|
220 |
col1, col2 = st.columns([1, 9])
|
221 |
with col1:
|
222 |
if st.button("Reset Data", key='reset1'):
|
@@ -341,6 +345,7 @@ with tab1:
|
|
341 |
)
|
342 |
|
343 |
with tab2:
|
|
|
344 |
col1, col2 = st.columns([1, 9])
|
345 |
with col1:
|
346 |
if st.button("Reset Data", key='reset2'):
|
@@ -431,6 +436,7 @@ with tab2:
|
|
431 |
)
|
432 |
|
433 |
with tab3:
|
|
|
434 |
col1, col2 = st.columns([1, 9])
|
435 |
with col1:
|
436 |
if st.button("Reset Data", key='reset3'):
|
@@ -513,6 +519,7 @@ with tab3:
|
|
513 |
)
|
514 |
|
515 |
with tab4:
|
|
|
516 |
col1, col2 = st.columns([1, 9])
|
517 |
with col1:
|
518 |
if st.button("Reset Data", key='reset4'):
|
|
|
94 |
rot_table[data_cols] = rot_table[data_cols].apply(pd.to_numeric, errors='coerce')
|
95 |
rot_table = rot_table[rot_table['Player'] != 0]
|
96 |
|
97 |
+
timestamp = gamelog_table['Date'].max()
|
98 |
+
|
99 |
+
return gamelog_table, rot_table, timestamp
|
100 |
|
101 |
@st.cache_data(show_spinner=False)
|
102 |
def seasonlong_build(data_sample):
|
|
|
197 |
def convert_df_to_csv(df):
|
198 |
return df.to_csv().encode('utf-8')
|
199 |
|
200 |
+
gamelog_table, rot_table, timestamp = init_baselines()
|
201 |
+
t_stamp = f"Updated through: " + str(timestamp) + f" CST"
|
202 |
basic_cols = ['Player', 'Pos', 'Team', 'Opp', 'Season', 'Date', 'Matchup', 'Min']
|
203 |
basic_season_cols = ['Pos', 'Team', 'Min']
|
204 |
data_cols = ['team_score', 'opp_score', 'spread', 'Touches', 'Pts', 'FGM', 'FGA', 'FG%', 'FG3M',
|
|
|
220 |
tab1, tab2, tab3, tab4 = st.tabs(['Gamelogs', 'Correlation Matrix', 'Position vs. Opp', 'Rotations'])
|
221 |
|
222 |
with tab1:
|
223 |
+
st.info(t_stamp)
|
224 |
col1, col2 = st.columns([1, 9])
|
225 |
with col1:
|
226 |
if st.button("Reset Data", key='reset1'):
|
|
|
345 |
)
|
346 |
|
347 |
with tab2:
|
348 |
+
st.info(t_stamp)
|
349 |
col1, col2 = st.columns([1, 9])
|
350 |
with col1:
|
351 |
if st.button("Reset Data", key='reset2'):
|
|
|
436 |
)
|
437 |
|
438 |
with tab3:
|
439 |
+
st.info(t_stamp)
|
440 |
col1, col2 = st.columns([1, 9])
|
441 |
with col1:
|
442 |
if st.button("Reset Data", key='reset3'):
|
|
|
519 |
)
|
520 |
|
521 |
with tab4:
|
522 |
+
st.info(t_stamp)
|
523 |
col1, col2 = st.columns([1, 9])
|
524 |
with col1:
|
525 |
if st.button("Reset Data", key='reset4'):
|