James McCool commited on
Commit
3173651
·
1 Parent(s): cb63196

Cast 'Top Score' to float in scoring percentages calculation in app.py, ensuring consistency and accuracy in player metrics analysis.

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -87,6 +87,7 @@ def init_baselines():
87
  scoring_percentages = scoring_percentages[['Names', 'Avg First Inning', 'First Inning Lead Percentage', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Avg Score', '8+ runs', 'Win Percentage', 'Slate', 'Top Score']]
88
  scoring_percentages['8+ runs'] = scoring_percentages['8+ runs'].replace('%', '', regex=True).astype(float)
89
  scoring_percentages['Win Percentage'] = scoring_percentages['Win Percentage'].replace('%', '', regex=True).astype(float)
 
90
  dk_hitters_only = dk_roo[dk_roo['pos_group'] != 'Pitchers']
91
  dk_team_ownership = dk_hitters_only.groupby('Team')['Own%'].sum().reset_index()
92
  fd_hitters_only = fd_roo[fd_roo['pos_group'] != 'Pitchers']
 
87
  scoring_percentages = scoring_percentages[['Names', 'Avg First Inning', 'First Inning Lead Percentage', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Avg Score', '8+ runs', 'Win Percentage', 'Slate', 'Top Score']]
88
  scoring_percentages['8+ runs'] = scoring_percentages['8+ runs'].replace('%', '', regex=True).astype(float)
89
  scoring_percentages['Win Percentage'] = scoring_percentages['Win Percentage'].replace('%', '', regex=True).astype(float)
90
+ scoring_percentages['Top Score'] = scoring_percentages['Top Score'].astype(float)
91
  dk_hitters_only = dk_roo[dk_roo['pos_group'] != 'Pitchers']
92
  dk_team_ownership = dk_hitters_only.groupby('Team')['Own%'].sum().reset_index()
93
  fd_hitters_only = fd_roo[fd_roo['pos_group'] != 'Pitchers']