Created
August 31, 2015 01:25
-
-
Save marshyski/06edc266eecb7d3af094 to your computer and use it in GitHub Desktop.
Just playing around with NFL Game Python lib
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 nflgame | |
games = nflgame.games(2014, week=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]) | |
#games = nflgame.games(2015, kind='PRE') | |
players = nflgame.combine_game_stats(games) | |
print "\n Top 10 Rushing TDS \n" | |
for p in players.rushing().sort('rushing_tds').limit(10): | |
msg = '%s %d carries for %d yards and %d TDs' | |
print msg % (p, p.rushing_att, p.rushing_yds, p.rushing_tds) | |
print "\n Top 10 Touchdowners \n" | |
for p in players.touchdowns().sort('tds').limit(10): | |
print p, p.tds | |
print "\n Top 10 Receiving Target \n" | |
players = nflgame.combine(games, plays=True) | |
for p in players.sort('receiving_tar').limit(10): | |
print p, p.receiving_tar | |
print "\n Top 10 Receiving TDS \n" | |
for p in players.sort('receiving_tds').limit(10): | |
print p, p.receiving_tds | |
print "\n Top 10 Passing TDS \n" | |
for p in players.sort('passing_tds').limit(10): | |
print p, p.passing_tds | |
print "\n Top 10 Passing YDS \n" | |
for p in players.sort('passing_yds').limit(10): | |
print p, p.passing_yds, p.passing_int | |
print "\n Top 10 Passing Interceptions \n" | |
for p in players.sort('passing_int').limit(10): | |
print p, p.passing_int | |
print "\n Top 10 Fumbles \n" | |
for p in players.sort('fumbles_tot').limit(10): | |
print p, p.fumbles_tot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment