Last active
October 27, 2015 23:01
-
-
Save ochawkeye/360ca56762e2f229626f 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 | |
from collections import defaultdict | |
db = nfldb.connect() | |
q = nfldb.Query(db) | |
q.game(season_year=2015, week=7) | |
results = {team[0]: {} for team in nfldb.team.teams} | |
for d in q.as_drives(): | |
if d.result not in results[d.pos_team]: | |
results[d.pos_team][d.result] = 1 | |
else: | |
results[d.pos_team][d.result] += 1 | |
for team in results: | |
print team, results[team] |
Author
ochawkeye
commented
Oct 27, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment