Closed Hisairnessag3 closed 6 years ago
MLB doesn't provide this info as a team stat. You will have to calculate it per player:
player_stats = mlbgame.player_stats(game.game_id)
hbp_home = sum([ p.hbp for p in player_stats.home_batting ])
Sabremetrics would have to be calculated based on individual statistics and then summed. Fangraphs has some information on how to calculate stats like wRC, FIP, and wOPA. You should be able to build arrays and then build list comprehension summations from those individual stats.
@trevor-viljoen has provided the correct answer, closing.
^ Getting this error on the player stats object
Also is there a way to grab or calculate advanced sabermetrics like wRC, FIP, wOPA, etc for teams(not players) on a game level basis. I am working on some ML models and that would be really helpful. Would do any API work myself just want to know if it can be done.