Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offensive plays ran by a team #338

Open
naymikm opened this issue Oct 5, 2017 · 0 comments
Open

Offensive plays ran by a team #338

naymikm opened this issue Oct 5, 2017 · 0 comments

Comments

@naymikm
Copy link

naymikm commented Oct 5, 2017

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
@naymikm naymikm changed the title Plays successfully ran by each team Offensive plays ran by each team Oct 5, 2017
@naymikm naymikm changed the title Offensive plays ran by each team Offensive plays ran by a team Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant