James McCool
commited on
Commit
·
c99fc4d
1
Parent(s):
4e5f9a7
Enhance exposure_spread function to assign the selected comparable player to both the player location and a new 'player_change' column, improving tracking of player adjustments in lineups.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -40,8 +40,10 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
|
|
| 40 |
|
| 41 |
# for each row to the the number of lineups to remove, replace with random choice from comparable player list
|
| 42 |
for row in range(math.ceil(lineups_to_remove)):
|
|
|
|
| 43 |
player_location = list(player_rows.iloc[row]).index(exposure_player)
|
| 44 |
-
working_frame.iloc[row, player_location] =
|
|
|
|
| 45 |
|
| 46 |
return working_frame
|
| 47 |
|
|
|
|
| 40 |
|
| 41 |
# for each row to the the number of lineups to remove, replace with random choice from comparable player list
|
| 42 |
for row in range(math.ceil(lineups_to_remove)):
|
| 43 |
+
insert_player = random.choice(comparable_player_list)
|
| 44 |
player_location = list(player_rows.iloc[row]).index(exposure_player)
|
| 45 |
+
working_frame.iloc[row, player_location] = insert_player
|
| 46 |
+
working_frame.iloc[row, 'player_change'] = insert_player
|
| 47 |
|
| 48 |
return working_frame
|
| 49 |
|