James McCool
commited on
Commit
·
5f539f7
1
Parent(s):
fe3cdfc
Enhance input field labels and filtering logic in app.py for better clarity
Browse files- Updated labels for number input fields to specify "Low end" and "High end" of ranges, improving user understanding.
- Added filtering logic for stack selection and entry count ranges to enhance data filtering capabilities.
app.py
CHANGED
@@ -237,14 +237,14 @@ with tab2:
|
|
237 |
entry_parse_var = st.selectbox("Do you want to view a specific user(s)?", ['All', 'Specific'], key = 'entry_parse_var')
|
238 |
entry_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'entry_names')
|
239 |
with entries_var:
|
240 |
-
low_entries_var = st.number_input("
|
241 |
-
high_entries_var = st.number_input("
|
242 |
with stack_var:
|
243 |
stack_parse_var = st.selectbox("Do you want to view lineups with specific team(s)?", ['All', 'Specific'], key = 'stack_parse_var')
|
244 |
stack_names = st.multiselect("Select teams", options=working_df['stack'].unique(), default=[], key = 'stack_names')
|
245 |
with stack_size_var:
|
246 |
-
low_stack_size_var = st.number_input("
|
247 |
-
high_stack_size_var = st.number_input("
|
248 |
with player_var:
|
249 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
250 |
player_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'player_names')
|
@@ -257,6 +257,14 @@ with tab2:
|
|
257 |
# Apply entry name filter if specific entries are selected
|
258 |
if entry_parse_var == 'Specific' and entry_names:
|
259 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
|
261 |
# Initialize pagination in session state if not exists
|
262 |
if 'current_page' not in st.session_state:
|
|
|
237 |
entry_parse_var = st.selectbox("Do you want to view a specific user(s)?", ['All', 'Specific'], key = 'entry_parse_var')
|
238 |
entry_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'entry_names')
|
239 |
with entries_var:
|
240 |
+
low_entries_var = st.number_input("Low end of entries range", min_value=0, max_value=150, value=1, key = 'low_entries_var')
|
241 |
+
high_entries_var = st.number_input("High end of entries range", min_value=0, max_value=150, value=150, key = 'high_entries_var')
|
242 |
with stack_var:
|
243 |
stack_parse_var = st.selectbox("Do you want to view lineups with specific team(s)?", ['All', 'Specific'], key = 'stack_parse_var')
|
244 |
stack_names = st.multiselect("Select teams", options=working_df['stack'].unique(), default=[], key = 'stack_names')
|
245 |
with stack_size_var:
|
246 |
+
low_stack_size_var = st.number_input("Low end of stack size range", min_value=0, max_value=5, value=1, key = 'low_stack_size_var')
|
247 |
+
high_stack_size_var = st.number_input("High end of stack size range", min_value=0, max_value=5, value=5, key = 'high_stack_size_var')
|
248 |
with player_var:
|
249 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
250 |
player_names = st.multiselect("Select players", options=st.session_state['entry_list'], default=[], key = 'player_names')
|
|
|
257 |
# Apply entry name filter if specific entries are selected
|
258 |
if entry_parse_var == 'Specific' and entry_names:
|
259 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
260 |
+
if stack_parse_var == 'Specific' and stack_names:
|
261 |
+
working_df = working_df[working_df['stack'].isin(stack_names)]
|
262 |
+
if stack_size_var == 'Specific' and low_stack_size_var and high_stack_size_var:
|
263 |
+
working_df = working_df[working_df['stack_size'].between(low_stack_size_var, high_stack_size_var)]
|
264 |
+
# if player_parse_var == 'Specific' and player_names:
|
265 |
+
# working_df = working_df[working_df['BaseName'].isin(player_names)]
|
266 |
+
if low_entries_var and high_entries_var:
|
267 |
+
working_df = working_df[working_df['EntryCount'].between(low_entries_var, high_entries_var)]
|
268 |
|
269 |
# Initialize pagination in session state if not exists
|
270 |
if 'current_page' not in st.session_state:
|