Skip to content

Instantly share code, notes, and snippets.

@ochawkeye
Last active October 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochawkeye/218af58fe96dcf4083df to your computer and use it in GitHub Desktop.
Save ochawkeye/218af58fe96dcf4083df to your computer and use it in GitHub Desktop.
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
@chppppp
Copy link

chppppp 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