Closed jaydeluca closed 6 years ago
stats.players.name('S.Harris')
must be generating the stats from .combine_game_stats
.
import nflgame
# stats = nflgame.one(2017, week=1, home='DEN', away='LAC')
game = nflgame.one(2017, week=1, home='DEN', away='LAC') # Pedantically changing this name to a closer description
players_game = nflgame.combine_game_stats([game]) # combine_X_stats expects a list of games
players_play = nflgame.combine_play_stats([game])
players_max = nflgame.combine_max_stats([game])
for player in players_game.filter(name='S.Harris'):
print player, player.formatted_stats(), type(player)
# S.Harris defense_ffum: 0, defense_tkl: 0, defense_int: 0, defense_ast: 2, defense_sk: 0 <class 'nflgame.player.GamePlayerStats'>
for player in players_play.filter(name='S.Harris'):
print player, player.formatted_stats(), type(player)
# S.Harris defense_qbhit: 1, defense_ast: 2, defense_fgblk: 1 <class 'nflgame.player.PlayPlayerStats'>
for player in players_max.filter(name='S.Harris'):
print player, player.formatted_stats(), type(player)
# S.Harris defense_qbhit: 1, defense_fgblk: 1, defense_ast: 2, defense_sk: 0, defense_tkl: 0, defense_ffum: 0, defense_int: 0 <class 'nflgame.player.GamePlayerStats'>
@ochawkeye thank you so much. Worked perfect.
In Week 1 Shelby Harris on the Denver Broncos had a blocked field goal. (Which can be seen on the stats tab of this page: http://www.espn.com/nfl/player/stats/_/id/16837/shelby-harris)
I assumed this would populate the metric defense_fgblk
Here is what is retrieved:
Any idea why this isn't being populated?