James McCool
commited on
Commit
·
0132b29
1
Parent(s):
d856d09
Refactor player filtering logic in app.py to simplify mask conditions. Updated the include and remove masks to use row.values instead of converting to lists, improving code efficiency and readability.
Browse files
app.py
CHANGED
|
@@ -1318,12 +1318,13 @@ with tab2:
|
|
| 1318 |
|
| 1319 |
player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1320 |
|
|
|
|
| 1321 |
include_mask = parsed_frame[player_columns].apply(
|
| 1322 |
-
lambda row: all(player in
|
| 1323 |
)
|
| 1324 |
|
| 1325 |
remove_mask = parsed_frame[player_columns].apply(
|
| 1326 |
-
lambda row: not any(player in
|
| 1327 |
)
|
| 1328 |
|
| 1329 |
|
|
@@ -1343,12 +1344,13 @@ with tab2:
|
|
| 1343 |
|
| 1344 |
player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1345 |
|
|
|
|
| 1346 |
include_mask = parsed_frame[player_columns].apply(
|
| 1347 |
-
lambda row: all(player in
|
| 1348 |
)
|
| 1349 |
-
|
| 1350 |
remove_mask = parsed_frame[player_columns].apply(
|
| 1351 |
-
lambda row: not any(player in
|
| 1352 |
)
|
| 1353 |
|
| 1354 |
|
|
|
|
| 1318 |
|
| 1319 |
player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1320 |
|
| 1321 |
+
# Test with a simpler approach
|
| 1322 |
include_mask = parsed_frame[player_columns].apply(
|
| 1323 |
+
lambda row: all(player in row.values for player in conditional_include_players), axis=1
|
| 1324 |
)
|
| 1325 |
|
| 1326 |
remove_mask = parsed_frame[player_columns].apply(
|
| 1327 |
+
lambda row: not any(player in row.values for player in conditional_remove_players), axis=1
|
| 1328 |
)
|
| 1329 |
|
| 1330 |
|
|
|
|
| 1344 |
|
| 1345 |
player_columns = [col for col in parsed_frame.columns if col not in excluded_cols]
|
| 1346 |
|
| 1347 |
+
# Test with a simpler approach
|
| 1348 |
include_mask = parsed_frame[player_columns].apply(
|
| 1349 |
+
lambda row: all(player in row.values for player in conditional_include_players), axis=1
|
| 1350 |
)
|
| 1351 |
+
|
| 1352 |
remove_mask = parsed_frame[player_columns].apply(
|
| 1353 |
+
lambda row: not any(player in row.values for player in conditional_remove_players), axis=1
|
| 1354 |
)
|
| 1355 |
|
| 1356 |
|