James McCool
commited on
Commit
·
8aaea01
1
Parent(s):
dee19f8
Refactor player selection logic in app.py for improved filtering accuracy
Browse files- Updated the player selection filtering condition to use 'all' instead of 'any', ensuring that only lineups containing all specified players are included in the results, enhancing the precision of the filtering process.
app.py
CHANGED
@@ -257,7 +257,7 @@ with tab2:
|
|
257 |
del st.session_state['player_frame']
|
258 |
if 'stack_frame' in st.session_state:
|
259 |
del st.session_state['stack_frame']
|
260 |
-
|
261 |
if entry_parse_var == 'Specific' and entry_names:
|
262 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
263 |
if stack_parse_var == 'Specific' and stack_names:
|
@@ -265,7 +265,7 @@ with tab2:
|
|
265 |
if stack_size_parse_var == 'Specific' and stack_size_names:
|
266 |
working_df = working_df[working_df['stack_size'].isin(stack_size_names)]
|
267 |
if player_parse_var == 'Specific' and player_names:
|
268 |
-
mask = working_df[player_columns].apply(lambda row:
|
269 |
working_df = working_df[mask]
|
270 |
if low_entries_var and high_entries_var:
|
271 |
working_df = working_df[working_df['EntryCount'].between(low_entries_var, high_entries_var)]
|
|
|
257 |
del st.session_state['player_frame']
|
258 |
if 'stack_frame' in st.session_state:
|
259 |
del st.session_state['stack_frame']
|
260 |
+
|
261 |
if entry_parse_var == 'Specific' and entry_names:
|
262 |
working_df = working_df[working_df['BaseName'].isin(entry_names)]
|
263 |
if stack_parse_var == 'Specific' and stack_names:
|
|
|
265 |
if stack_size_parse_var == 'Specific' and stack_size_names:
|
266 |
working_df = working_df[working_df['stack_size'].isin(stack_size_names)]
|
267 |
if player_parse_var == 'Specific' and player_names:
|
268 |
+
mask = working_df[player_columns].apply(lambda row: all(player in row.values for player in player_names), axis=1)
|
269 |
working_df = working_df[mask]
|
270 |
if low_entries_var and high_entries_var:
|
271 |
working_df = working_df[working_df['EntryCount'].between(low_entries_var, high_entries_var)]
|