James McCool commited on
Commit
170fe18
·
1 Parent(s): 1a1e2d1

Update exposure_spread function to correct stack comparison logic by using the 'team' column instead of 'Stack', ensuring accurate filtering of player rows based on stacking criteria.

Browse files
Files changed (1) hide show
  1. global_func/exposure_spread.py +3 -3
global_func/exposure_spread.py CHANGED
@@ -12,7 +12,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
12
  # Find comparable players in the projections
13
  comparable_players = projections_df[projections_df['player_names'] == exposure_player]
14
  if exposure_stack_bool == 'Yes':
15
- comparable_stack = comparable_players['Stack'][0]
16
  else:
17
  comparable_stack = 0
18
  comparable_players = comparable_players.reset_index(drop=True)
@@ -54,8 +54,8 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
54
  # isolate the rows that contain the player
55
  player_rows = working_frame[player_mask]
56
  print(player_rows.head(10))
57
- # if comparable_stack != 0:
58
- # player_rows = player_rows[player_rows['Stack'] != comparable_stack]
59
  print(player_rows.head(10))
60
  print(working_frame.head(10))
61
 
 
12
  # Find comparable players in the projections
13
  comparable_players = projections_df[projections_df['player_names'] == exposure_player]
14
  if exposure_stack_bool == 'Yes':
15
+ comparable_stack = comparable_players['team'][0]
16
  else:
17
  comparable_stack = 0
18
  comparable_players = comparable_players.reset_index(drop=True)
 
54
  # isolate the rows that contain the player
55
  player_rows = working_frame[player_mask]
56
  print(player_rows.head(10))
57
+ if comparable_stack != 0:
58
+ player_rows = player_rows[player_rows['Stack'] != comparable_stack]
59
  print(player_rows.head(10))
60
  print(working_frame.head(10))
61