James McCool
commited on
Commit
·
3df4bec
1
Parent(s):
717655e
Fix player removal logic in distribute_preset.py to correctly filter out players not in the player_out list. This change enhances the accuracy of the portfolio distribution process by ensuring only relevant players are retained.
Browse files
global_func/distribute_preset.py
CHANGED
@@ -57,7 +57,7 @@ def distribute_preset(portfolio: pd.DataFrame, lineup_target: int, exclude_cols:
|
|
57 |
rows_to_drop = []
|
58 |
working_portfolio = portfolio.copy()
|
59 |
remove_mask = working_portfolio[player_columns].apply(
|
60 |
-
lambda row: not
|
61 |
)
|
62 |
working_portfolio = working_portfolio[remove_mask]
|
63 |
print(working_portfolio.head(10))
|
|
|
57 |
rows_to_drop = []
|
58 |
working_portfolio = portfolio.copy()
|
59 |
remove_mask = working_portfolio[player_columns].apply(
|
60 |
+
lambda row: player_out not in list(row)
|
61 |
)
|
62 |
working_portfolio = working_portfolio[remove_mask]
|
63 |
print(working_portfolio.head(10))
|