Hi, I'm hoping someone can help we with some Python script.
I'm trying to pull the total penalty yards for a particular team in a particular
game from the nfldb database.
The script I have developed so far returns each drive resulting in a penalty,
but I'd like to get just the total penalty yards in a game. I'm using Python 2.7
any help would be greatly appreciated!
I'm trying to pull the total penalty yards for a particular team in a particular
game from the nfldb database.
The script I have developed so far returns each drive resulting in a penalty,
but I'd like to get just the total penalty yards in a game. I'm using Python 2.7
any help would be greatly appreciated!
Code:
import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2015, season_type='Regular', week=6, team='NE')
q.drive().play(penalty_yds__gt=0)
for play in q.as_plays():
print play