Skip to content

Instantly share code, notes, and snippets.

@ochawkeye
Created November 1, 2015 13:32
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/d9142330323d803d8fd5 to your computer and use it in GitHub Desktop.
Save ochawkeye/d9142330323d803d8fd5 to your computer and use it in GitHub Desktop.
import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2015)
q.player(full_name='Tom Brady')
q.play(offense_tds=1)
def redzone(field):
cutoff = nfldb.FieldPosition.from_str(field)
return lambda play: play.yardline >= cutoff
plays = filter(redzone('OPP 20'), q.as_plays())
rz_tds, rz_ptds, rz_rtds = 0, 0, 0
for play in plays:
print play
rz_tds += 1
rz_ptds += play.passing_tds
rz_rtds += play.rushing_tds
print 'Tom Brady total redzone touchdowns:', rz_tds
print 'Tom Brady passing redzone touchdowns:', rz_ptds
print 'Tom Brady rushing redzone touchdowns:', rz_rtds
@ochawkeye
Copy link
Author

(NE, OPP 18, Q2, 2 and 10) (:56) (Shotgun) T.Brady pass deep left to S.Chandler for 18 yards, TOUCHDOWN.
(NE, OPP 16, Q2, 1 and 10) (11:16) (Shotgun) T.Brady pass short right to R.Gronkowski for 16 yards, TOUCHDOWN.
(NE, OPP 6, Q2, 2 and 6) (4:06) T.Brady pass short middle to R.Gronkowski for 6 yards, TOUCHDOWN. NE 87-Gronkowski 15th career multi-TD game.
(NE, OPP 1, Q3, 2 and 1) (10:43) T.Brady pass short left to S.Chandler for 1 yard, TOUCHDOWN.
(NE, OPP 1, Q4, 3 and 1) (9:24) T.Brady pass short left to R.Gronkowski for 1 yard, TOUCHDOWN. NE 12-Brady 23rd career game with 4+ TD passes, tying Brett Favre for 3rd most all-time. NE 12-Brady 396 career TD passes, tying Drew Brees for 4th most all-time. NE 87-Gronkowski 3rd career 3-TD game.
(NE, OPP 8, Q1, 3 and 8) (4:08) (Shotgun) T.Brady pass short right to J.Edelman for 8 yards, TOUCHDOWN. Caught at goal line, crossing from middle.
(NE, OPP 2, Q2, 2 and 2) (13:18) T.Brady pass short middle to R.Gronkowski for 2 yards, TOUCHDOWN. Caught 7 yds. into end zone, crossing from left.
(NE, OPP 1, Q2, 2 and 1) (:22) T.Brady pass short middle to D.Amendola for 1 yard, TOUCHDOWN. NE 12-Brady 400 career TD passes, 4th most all-time.
(NE, OPP 13, Q3, 2 and 8) (3:25) (Shotgun) T.Brady pass short left to K.Martin for 13 yards, TOUCHDOWN.
(NE, OPP 1, Q2, 1 and 1) (3:42) T.Brady up the middle for 1 yard, TOUCHDOWN. Quarterback keeper.
(NE, OPP 10, Q3, 1 and 10) (9:55) T.Brady pass short right to D.Lewis for 10 yards, TOUCHDOWN. Pass complete in the flat; ducked two tacklers for the score.
(NE, OPP 12, Q1, 2 and 10) (2:56) (Shotgun) T.Brady pass short middle to J.Edelman for 12 yards, TOUCHDOWN.
(NE, OPP 11, Q4, 2 and 8) (12:56) (Shotgun) T.Brady pass short right to L.Blount for 11 yards, TOUCHDOWN.
(NE, OPP 1, Q2, 4 and 1) (6:26) R.Wendell reported in as eligible.  T.Brady up the middle for 1 yard, TOUCHDOWN.
(NE, OPP 8, Q4, 3 and 6) (7:22) (Shotgun) T.Brady pass short middle to D.Amendola for 8 yards, TOUCHDOWN.
(NE, OPP 15, Q4, 2 and 3) (1:18) (Shotgun) T.Brady pass short left to R.Gronkowski for 15 yards, TOUCHDOWN. NE 87-Gronkowski 18th career 100-yard game, extends his Patriots record for a TE.
(NE, OPP 16, Q2, 1 and 16) (:29) (Shotgun) T.Brady pass short middle to D.Lewis for 16 yards, TOUCHDOWN.
(NE, OPP 10, Q4, 3 and 5) (13:33) (Shotgun) T.Brady pass short left to J.Edelman for 10 yards, TOUCHDOWN.
(NE, OPP 16, Q4, 2 and 16) (7:23) (Shotgun) T.Brady pass short middle to J.Edelman for 16 yards, TOUCHDOWN. NE 12-Brady 24th career game with 4+ TD passes, 3rd most all-time. NE 12-Brady 19th career game with 4+ TD passes & no interceptions, most all-time (Brees & P. Manning have 18).
Tom Brady total redzone touchdowns: 19
Tom Brady passing redzone touchdowns: 17
Tom Brady rushing redzone touchdowns: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment