Is there a way to access the number of offensive plays ran by each team in a game? I wrote a function to do this but it relies on some possibly unreliable specific strings in the play text.
def numPlays(year,week,team):
games=nflgame.games(year, week=week, home=team,away=team)
plays = nflgame.combine_plays(games)
n = 0
for play in plays.filter(team=team):
if 'No Play' not in str(play) and 'kicks' not in str(play):
n+=1
return n
Is there a way to access the number of offensive plays ran by each team in a game? I wrote a function to do this but it relies on some possibly unreliable specific strings in the play text.