jbisal commited on
Commit
d6877f7
·
verified ·
1 Parent(s): 63f62a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -95,10 +95,10 @@ 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_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
- print(stats[player[list(player.keys())[0]]])
102
  return stats
103
  except Exception as e:
104
  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 stat_key in player:
99
+ if player[stat_key] is not None:
100
+ if player[stat_key].replace('.', '').isdigit():
101
+ stats[player[list(player.keys())[0]]]=pd.to_numeric(player[stat_key], errors='coerce')
102
  return stats
103
  except Exception as e:
104
  return {"Error": f"Error fetching boxScore data for given statistic: {str(e)}"}