jbisal commited on
Commit
c87005d
·
verified ·
1 Parent(s): 893547a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -95,8 +95,9 @@ def get_stats_from_boxScore_data(url: str, stat: str) -> dict:
95
  stat_key = ('Basic Box Score Stats', stat)
96
  for teams in box_scores.keys():
97
  for player in box_scores[teams]:
98
- if player[stat] is not None:
99
- stats[player[list(player.keys())[0]]]=pd.to_numeric(player[stat_key], errors='coerce')
 
100
  return stats
101
  except Exception as e:
102
  return {"Error": f"Error fetching boxScore data for given statistic: {str(e)}"}
 
95
  stat_key = ('Basic Box Score Stats', stat)
96
  for teams in box_scores.keys():
97
  for player in box_scores[teams]:
98
+ if player[stat_key] is not None:
99
+ if player[stat_key].replace('.').isdigit()
100
+ stats[player[list(player.keys())[0]]]=pd.to_numeric(player[stat_key], errors='coerce')
101
  return stats
102
  except Exception as e:
103
  return {"Error": f"Error fetching boxScore data for given statistic: {str(e)}"}