Multichem commited on
Commit
ef20cbe
·
1 Parent(s): dd81fad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -250,7 +250,7 @@ with tab1:
250
  choose_cols = st.container()
251
  with choose_cols:
252
  choose_disp = st.multiselect('Which stats would you like to view?', options = season_data_cols, default = season_data_cols, key='col_display')
253
- disp_stats = basic_cols + choose_disp
254
  display = st.container()
255
  gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
256
  gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
@@ -260,12 +260,14 @@ with tab1:
260
  gamelog_table = gamelog_table[gamelog_table['Player'].isin(player_var1)]
261
  season_long_table = seasonlong_build(gamelog_table)
262
  season_long_table = season_long_table.set_index('Player')
263
- season_long_table_disp = season_long_table[[disp_stats]]
264
  display.dataframe(season_long_table_disp.style.format(precision=2), height=750, use_container_width = True)
265
 
266
  elif split_var1 == 'Gamelogs':
267
  choose_cols = st.container()
268
- choose_cols.multiselect('Which stats would you like to view?', options = data_cols, default = data_cols, key='col_display')
 
 
269
  gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
270
  gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
271
  gamelog_table = gamelog_table[gamelog_table['TOI'] >= min_var1[0]]
 
250
  choose_cols = st.container()
251
  with choose_cols:
252
  choose_disp = st.multiselect('Which stats would you like to view?', options = season_data_cols, default = season_data_cols, key='col_display')
253
+ disp_stats = basic_season_cols + choose_disp
254
  display = st.container()
255
  gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
256
  gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
 
260
  gamelog_table = gamelog_table[gamelog_table['Player'].isin(player_var1)]
261
  season_long_table = seasonlong_build(gamelog_table)
262
  season_long_table = season_long_table.set_index('Player')
263
+ season_long_table_disp = season_long_table.reindex(disp_stats,axis="columns")
264
  display.dataframe(season_long_table_disp.style.format(precision=2), height=750, use_container_width = True)
265
 
266
  elif split_var1 == 'Gamelogs':
267
  choose_cols = st.container()
268
+ with choose_cols:
269
+ choose_disp = st.multiselect('Which stats would you like to view?', options = data_cols, default = data_cols, key='col_display')
270
+ disp_stats = basic_cols + choose_disp
271
  gamelog_table = gamelog_table[gamelog_table['Date'] >= low_date]
272
  gamelog_table = gamelog_table[gamelog_table['Date'] <= high_date]
273
  gamelog_table = gamelog_table[gamelog_table['TOI'] >= min_var1[0]]