Created
October 27, 2015 22:36
-
-
Save ochawkeye/bb72b6cb2cd5e14a1a0e 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) | |
interceptions = {team[0]: 0 for team in nfldb.team.teams} | |
fumble_recoveries = {team[0]: 0 for team in nfldb.team.teams} | |
turnovers = {team[0]: 0 for team in nfldb.team.teams} | |
for pp in q.as_play_players(): | |
interceptions[pp.team] += pp.defense_int | |
fumble_recoveries[pp.team] += pp.defense_frec | |
turnovers[pp.team] += pp.defense_int + pp.defense_frec | |
print interceptions | |
print fumble_recoveries | |
print turnovers |
Author
ochawkeye
commented
Oct 27, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment