James McCool
commited on
Commit
·
0f7b331
1
Parent(s):
c99fc4d
Refactor exposure_spread function to simplify player assignment by using the .at method for direct access to player locations, enhancing code readability and performance.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -42,8 +42,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
|
|
| 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.
|
| 46 |
-
working_frame.iloc[row, 'player_change'] = insert_player
|
| 47 |
|
| 48 |
return working_frame
|
| 49 |
|
|
|
|
| 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.at[row, player_location] = insert_player
|
|
|
|
| 46 |
|
| 47 |
return working_frame
|
| 48 |
|