Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -171,6 +171,7 @@ def convert_df_to_csv(df):
|
|
171 |
return df.to_csv().encode('utf-8')
|
172 |
|
173 |
gamelog_table = init_baselines()
|
|
|
174 |
indv_teams = gamelog_table.drop_duplicates(subset='Team')
|
175 |
total_teams = indv_teams.Team.values.tolist()
|
176 |
indv_players = gamelog_table.drop_duplicates(subset='Player')
|
@@ -185,6 +186,7 @@ with tab1:
|
|
185 |
if st.button("Reset Data", key='reset1'):
|
186 |
st.cache_data.clear()
|
187 |
gamelog_table = init_baselines()
|
|
|
188 |
indv_teams = gamelog_table.drop_duplicates(subset='Team')
|
189 |
total_teams = indv_teams.Team.values.tolist()
|
190 |
indv_players = gamelog_table.drop_duplicates(subset='Player')
|
@@ -223,6 +225,9 @@ with tab1:
|
|
223 |
|
224 |
with col2:
|
225 |
if split_var1 == 'Season Logs':
|
|
|
|
|
|
|
226 |
display = st.container()
|
227 |
gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
|
228 |
gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
|
@@ -235,6 +240,9 @@ with tab1:
|
|
235 |
display.dataframe(season_long_table.style.format(precision=2), height=750, use_container_width = True)
|
236 |
|
237 |
elif split_var1 == 'Gamelogs':
|
|
|
|
|
|
|
238 |
gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
|
239 |
gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
|
240 |
gamelog_table = gamelog_table[gamelog_table['TOI'] >= min_var1[0]]
|
|
|
171 |
return df.to_csv().encode('utf-8')
|
172 |
|
173 |
gamelog_table = init_baselines()
|
174 |
+
data_cols = gamelog_table.columns.drop(['Player', 'Team', 'Position', 'Date', 'TOI'])
|
175 |
indv_teams = gamelog_table.drop_duplicates(subset='Team')
|
176 |
total_teams = indv_teams.Team.values.tolist()
|
177 |
indv_players = gamelog_table.drop_duplicates(subset='Player')
|
|
|
186 |
if st.button("Reset Data", key='reset1'):
|
187 |
st.cache_data.clear()
|
188 |
gamelog_table = init_baselines()
|
189 |
+
data_cols = gamelog_table.columns.drop(['Player', 'Team', 'Position', 'Date', 'TOI'])
|
190 |
indv_teams = gamelog_table.drop_duplicates(subset='Team')
|
191 |
total_teams = indv_teams.Team.values.tolist()
|
192 |
indv_players = gamelog_table.drop_duplicates(subset='Player')
|
|
|
225 |
|
226 |
with col2:
|
227 |
if split_var1 == 'Season Logs':
|
228 |
+
choose_cols = st.container()
|
229 |
+
with choose_cols:
|
230 |
+
col_display = st.multiselect('Which stats would you like to view?', options = data_cols, default = data_cols, key='col_display')
|
231 |
display = st.container()
|
232 |
gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
|
233 |
gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
|
|
|
240 |
display.dataframe(season_long_table.style.format(precision=2), height=750, use_container_width = True)
|
241 |
|
242 |
elif split_var1 == 'Gamelogs':
|
243 |
+
choose_cols = st.container()
|
244 |
+
with choose_cols:
|
245 |
+
col_display = st.multiselect('Which stats would you like to view?', options = data_cols, default = data_cols, key='col_display')
|
246 |
gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
|
247 |
gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
|
248 |
gamelog_table = gamelog_table[gamelog_table['TOI'] >= min_var1[0]]
|