Multichem commited on
Commit
9a3fd1a
·
1 Parent(s): 2364c0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -179,13 +179,13 @@ with tab2:
179
  player_check = st.selectbox('Select player to create comps', options = proj_dataframe['Player'].unique(), key='dk_player')
180
  with col4:
181
  if proj_file is not None:
182
- pos_var_list = st.multiselect('Which positions would you like to include?', options = proj_dataframe['Position'].unique(), key='pos_var_list')
183
  with col5:
184
  if st.button('Simulate appropriate pivots'):
185
  with hold_container:
186
 
187
  working_roo = proj_dataframe
188
- working_roo = working_roo[working_roo['Position'].isin(pos_var_list)]
189
  working_roo.rename(columns={"Minutes Proj": "Minutes_Proj"}, inplace = True)
190
  own_dict = dict(zip(working_roo.Player, working_roo.Own))
191
  min_dict = dict(zip(working_roo.Player, working_roo.Minutes_Proj))
@@ -285,4 +285,6 @@ with tab2:
285
 
286
  with col2:
287
  if 'player_freq' in st.session_state:
288
- st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
 
 
 
179
  player_check = st.selectbox('Select player to create comps', options = proj_dataframe['Player'].unique(), key='dk_player')
180
  with col4:
181
  if proj_file is not None:
182
+ pos_var_list = st.multiselect('Which positions would you like to include?', options = ['PG', 'SG', 'SF', 'PF', 'C'], key='pos_var_list')
183
  with col5:
184
  if st.button('Simulate appropriate pivots'):
185
  with hold_container:
186
 
187
  working_roo = proj_dataframe
188
+ working_roo = working_roo[working_roo['Position'].str.contains('|'.join(pos_var_list))]
189
  working_roo.rename(columns={"Minutes Proj": "Minutes_Proj"}, inplace = True)
190
  own_dict = dict(zip(working_roo.Player, working_roo.Own))
191
  min_dict = dict(zip(working_roo.Player, working_roo.Minutes_Proj))
 
285
 
286
  with col2:
287
  if 'player_freq' in st.session_state:
288
+ st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
289
+
290
+