James McCool
commited on
Commit
·
0b7d1f5
1
Parent(s):
97aa7d2
Refactor stack size selection in app.py for improved user experience
Browse files- Replaced number input fields for stack size with selectbox and multiselect options, allowing users to filter by specific stack sizes more intuitively.
- Updated filtering logic to accommodate the new selection method, enhancing data handling and user interaction.
app.py
CHANGED
@@ -244,8 +244,8 @@ with tab2:
|
|
244 |
stack_parse_var = st.selectbox("Do you want to view lineups with specific team(s)?", ['All', 'Specific'], key = 'stack_parse_var')
|
245 |
stack_names = st.multiselect("Select teams", options=working_df['stack'].unique(), default=[], key = 'stack_names')
|
246 |
with stack_size_var:
|
247 |
-
|
248 |
-
|
249 |
with player_var:
|
250 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
251 |
player_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'player_names')
|
@@ -260,9 +260,8 @@ with tab2:
|
|
260 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
261 |
if stack_parse_var == 'Specific' and stack_names:
|
262 |
working_df = working_df[working_df['stack'].isin(stack_names)]
|
263 |
-
if
|
264 |
-
working_df = working_df
|
265 |
-
working_df = working_df[working_df['stack_size'].between(low_stack_size_var, high_stack_size_var)]
|
266 |
|
267 |
# if player_parse_var == 'Specific' and player_names:
|
268 |
# working_df = working_df[working_df['BaseName'].isin(player_names)]
|
|
|
244 |
stack_parse_var = st.selectbox("Do you want to view lineups with specific team(s)?", ['All', 'Specific'], key = 'stack_parse_var')
|
245 |
stack_names = st.multiselect("Select teams", options=working_df['stack'].unique(), default=[], key = 'stack_names')
|
246 |
with stack_size_var:
|
247 |
+
stack_size_parse_var = st.selectbox("Do you want to view a specific stack size(s)?", ['All', 'Specific'], key = 'stack_size_parse_var')
|
248 |
+
stack_size_names = st.multiselect("Select stack sizes", options=working_df['stack_size'].unique(), default=[], key = 'stack_size_names')
|
249 |
with player_var:
|
250 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
251 |
player_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'player_names')
|
|
|
260 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
261 |
if stack_parse_var == 'Specific' and stack_names:
|
262 |
working_df = working_df[working_df['stack'].isin(stack_names)]
|
263 |
+
if stack_size_parse_var == 'Specific' and stack_size_names:
|
264 |
+
working_df = working_df[working_df['stack_size'].isin(stack_size_names)]
|
|
|
265 |
|
266 |
# if player_parse_var == 'Specific' and player_names:
|
267 |
# working_df = working_df[working_df['BaseName'].isin(player_names)]
|