James McCool
commited on
Commit
·
baf515a
1
Parent(s):
bdf6978
Add filtering for comparable players in exposure_spread.py based on team stacking for size 5 lineups, enhancing player selection accuracy.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -265,6 +265,12 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
|
|
| 265 |
(projections_df['salary'] <= comp_salary_high + (salary_max - working_frame['salary'][row])) &
|
| 266 |
(projections_df['position'].apply(lambda x: has_position_overlap(x, comp_player_position)))
|
| 267 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
|
| 269 |
if remove_teams is not None:
|
| 270 |
remove_mask = comparable_players.apply(
|
|
|
|
| 265 |
(projections_df['salary'] <= comp_salary_high + (salary_max - working_frame['salary'][row])) &
|
| 266 |
(projections_df['position'].apply(lambda x: has_position_overlap(x, comp_player_position)))
|
| 267 |
]
|
| 268 |
+
|
| 269 |
+
if row['Size'] == 5:
|
| 270 |
+
remove_mask = comparable_players.apply(
|
| 271 |
+
lambda row: not any(team in list(row) for team in working_frame['Stack'][row]), axis=1
|
| 272 |
+
)
|
| 273 |
+
comparable_players = comparable_players[remove_mask]
|
| 274 |
|
| 275 |
if remove_teams is not None:
|
| 276 |
remove_mask = comparable_players.apply(
|