Last active
October 29, 2015 14:24
-
-
Save ochawkeye/218af58fe96dcf4083df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nfldb | |
db = nfldb.connect() | |
q = nfldb.Query(db) | |
q.game(season_year=2015, week=7, team='MIN') | |
def redzone(field): | |
cutoff = nfldb.FieldPosition.from_str(field) | |
return lambda play: play.yardline >= cutoff | |
plays = filter(redzone('OPP 20'), q.as_plays()) | |
for play in plays: | |
print play |
Author
ochawkeye
commented
Oct 29, 2015
Why did you take it from as_plays rather as_drives?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment