James McCool commited on
Commit
2d5b5b0
·
1 Parent(s): dcc25f6

Refactor scoring percentage calculations in app.py by removing division by 100 for '8+ runs' and 'Win Percentage', improving data accuracy and simplifying the conversion process.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -85,8 +85,8 @@ def init_baselines():
85
  team_frame = pd.DataFrame(cursor)
86
  scoring_percentages = team_frame.drop(columns=['_id'])
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']]
88
- scoring_percentages['8+ runs'] = scoring_percentages['8+ runs'].replace('%', '', regex=True).astype(float) / 100
89
- scoring_percentages['Win Percentage'] = scoring_percentages['Win Percentage'].replace('%', '', regex=True).astype(float) / 100
90
 
91
  return roo_data, sd_roo_data, scoring_percentages, dk_roo, fd_roo
92
 
 
85
  team_frame = pd.DataFrame(cursor)
86
  scoring_percentages = team_frame.drop(columns=['_id'])
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']]
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
 
91
  return roo_data, sd_roo_data, scoring_percentages, dk_roo, fd_roo
92