patrickramos commited on
Commit
a97db14
·
1 Parent(s): 15d84ea

Fix pitcher order in pitcher overview

Browse files
Files changed (1) hide show
  1. plotting.py +1 -1
plotting.py CHANGED
@@ -20,7 +20,7 @@ from stats import get_pitcher_stats, filter_data_by_date_and_game_kind
20
  def get_card_data(id, **kwargs):
21
  both, left, right = get_pitcher_stats(id, **kwargs), get_pitcher_stats(id, 'l', **kwargs), get_pitcher_stats(id, 'r', **kwargs)
22
  pitcher_stats = both.pitcher_stats.join(left.pitcher_stats, on='pitId', suffix='_left').join(right.pitcher_stats, on='pitId', suffix='_right')
23
- pitch_stats = both.pitch_stats.join(left.pitch_stats, on='ballKind_code', how='full', suffix='_left').join(right.pitch_stats, on='ballKind_code', how='full', suffix='_right').fill_null(0)
24
  return SimpleNamespace(
25
  pitcher_stats=pitcher_stats,
26
  pitch_stats=pitch_stats,
 
20
  def get_card_data(id, **kwargs):
21
  both, left, right = get_pitcher_stats(id, **kwargs), get_pitcher_stats(id, 'l', **kwargs), get_pitcher_stats(id, 'r', **kwargs)
22
  pitcher_stats = both.pitcher_stats.join(left.pitcher_stats, on='pitId', suffix='_left').join(right.pitcher_stats, on='pitId', suffix='_right')
23
+ pitch_stats = both.pitch_stats.join(left.pitch_stats, on='ballKind_code', how='full', suffix='_left').join(right.pitch_stats, on='ballKind_code', how='full', suffix='_right').fill_null(0).sort('count', descending=True)
24
  return SimpleNamespace(
25
  pitcher_stats=pitcher_stats,
26
  pitch_stats=pitch_stats,