James McCool
commited on
Commit
·
5eac9be
1
Parent(s):
72d1643
Refactor exposure_spread function to improve list comparison for comparable_player_list, ensuring clarity and consistency in checks for non-empty lists.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -267,7 +267,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, comp_salary
|
|
| 267 |
except:
|
| 268 |
comparable_player_list = []
|
| 269 |
|
| 270 |
-
if comparable_player_list:
|
| 271 |
insert_player = random.choice(comparable_player_list)
|
| 272 |
# Find which column contains the exposure_player
|
| 273 |
if specific_columns != []:
|
|
@@ -326,7 +326,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, comp_salary
|
|
| 326 |
|
| 327 |
# Create a list of comparable players
|
| 328 |
comparable_player_list = comparable_players['player_names'].tolist()
|
| 329 |
-
if comparable_player_list:
|
| 330 |
# Find which column contains the exposure_player
|
| 331 |
if specific_columns != []:
|
| 332 |
row_data = working_frame.iloc[row][specific_columns]
|
|
|
|
| 267 |
except:
|
| 268 |
comparable_player_list = []
|
| 269 |
|
| 270 |
+
if comparable_player_list != []:
|
| 271 |
insert_player = random.choice(comparable_player_list)
|
| 272 |
# Find which column contains the exposure_player
|
| 273 |
if specific_columns != []:
|
|
|
|
| 326 |
|
| 327 |
# Create a list of comparable players
|
| 328 |
comparable_player_list = comparable_players['player_names'].tolist()
|
| 329 |
+
if comparable_player_list != []:
|
| 330 |
# Find which column contains the exposure_player
|
| 331 |
if specific_columns != []:
|
| 332 |
row_data = working_frame.iloc[row][specific_columns]
|