patrickramos commited on
Commit
fb7a65f
·
1 Parent(s): c6f6b34

Fix bug with team leaderboard columns

Browse files
Files changed (1) hide show
  1. player_team_leaderboard.py +7 -6
player_team_leaderboard.py CHANGED
@@ -64,14 +64,15 @@ def create_player_team_leaderboard_app(player_team_type):
64
  plate_disc_cols = ['Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%']
65
  batted_ball_cols = ['GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%']
66
  approach_cols = ['Strike%', 'Ball%', 'F-Str%', 'PAR%', 'Zone%', 'Arm%', 'Glove%', 'High%', 'Low%', 'MM%', 'Behind%']
 
 
 
67
  all_cols = {
68
  theme: prefix_cols + cols
69
  for theme, cols
70
  in {'Plate Discipline': plate_disc_cols, 'Batted Ball': batted_ball_cols, 'Approach': approach_cols}.items()
71
  }
72
- if team:
73
- # cols = [col for col in cols if col not in ('Pitcher', 'Throws')]
74
- prefix_cols = [col for col in prefix_cols if col not in ('Pitcher', 'Throws')]
75
  else:
76
  pct_stats = ['K%', 'BB%', 'Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%', 'GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%', 'Zone%', 'Arm%', 'Glove%', 'High%', 'Low%', 'MM%']
77
  stats_with_pctls = ['K%', 'BB%', 'Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%', 'GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%', 'Zone%'] # , 'OBP']
@@ -79,14 +80,14 @@ def create_player_team_leaderboard_app(player_team_type):
79
  prefix_cols = ['Batter', 'Team', 'Bats', 'PA', 'K%', 'BB%']
80
  plate_disc_cols = ['Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%']
81
  batted_ball_cols = ['GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%']
 
 
 
82
  all_cols = {
83
  theme: prefix_cols + cols
84
  for theme, cols
85
  in {'Plate Discipline': plate_disc_cols, 'Batted Ball': batted_ball_cols}.items()
86
  }
87
- if team:
88
- # cols = [col for col in cols if col not in ('Batter', 'Bats')]
89
- prefix_cols = [col for col in prefix_cols if col not in ('Batter', 'Bats')]
90
 
91
 
92
  # col names
 
64
  plate_disc_cols = ['Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%']
65
  batted_ball_cols = ['GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%']
66
  approach_cols = ['Strike%', 'Ball%', 'F-Str%', 'PAR%', 'Zone%', 'Arm%', 'Glove%', 'High%', 'Low%', 'MM%', 'Behind%']
67
+ if team:
68
+ # cols = [col for col in cols if col not in ('Pitcher', 'Throws')]
69
+ prefix_cols = [col for col in prefix_cols if col not in ('Pitcher', 'Throws')]
70
  all_cols = {
71
  theme: prefix_cols + cols
72
  for theme, cols
73
  in {'Plate Discipline': plate_disc_cols, 'Batted Ball': batted_ball_cols, 'Approach': approach_cols}.items()
74
  }
75
+
 
 
76
  else:
77
  pct_stats = ['K%', 'BB%', 'Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%', 'GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%', 'Zone%', 'Arm%', 'Glove%', 'High%', 'Low%', 'MM%']
78
  stats_with_pctls = ['K%', 'BB%', 'Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%', 'GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%', 'Zone%'] # , 'OBP']
 
80
  prefix_cols = ['Batter', 'Team', 'Bats', 'PA', 'K%', 'BB%']
81
  plate_disc_cols = ['Swing%', 'Z-Swing%', 'Chase%', 'Contact%', 'Z-Contact%', 'O-Contact%', 'SwStr%', 'Whiff%', 'CSW%']
82
  batted_ball_cols = ['GB%', 'FB%', 'LD%', 'OFFB%', 'IFFB%', 'AIR%']
83
+ if team:
84
+ # cols = [col for col in cols if col not in ('Batter', 'Bats')]
85
+ prefix_cols = [col for col in prefix_cols if col not in ('Batter', 'Bats')]
86
  all_cols = {
87
  theme: prefix_cols + cols
88
  for theme, cols
89
  in {'Plate Discipline': plate_disc_cols, 'Batted Ball': batted_ball_cols}.items()
90
  }
 
 
 
91
 
92
 
93
  # col names