Created
January 25, 2014 17:32
-
-
Save atestu/8620132 to your computer and use it in GitHub Desktop.
Using nfldb to get the top players in the NFL in 2013
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 | |
import json | |
from pprint import pprint | |
db = nfldb.connect() | |
q = nfldb.Query(db) | |
q.game(season_year=2013).player() | |
print json.dumps(map(lambda pp: { | |
'player': pp.player.full_name, | |
'team': pp.player.team, | |
'receiving_yds': pp.receiving_yds, | |
'fumbles_tot': pp.fumbles_tot, | |
'rushing_yds': pp.rushing_yds, | |
'tackles': pp.defense_tkl_primary | |
}, q.sort('receiving_yds').as_aggregate())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment