-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Season passing yards #213
Comments
In my experience, the aggregate numbers are not going to perfectly match official sources but they are close enough for most purposes. If you run the example code for QB passing leaders, it is within a few yards of what is listed on other sites. As an aside, it would be helpful to have more convenience methods to get the stats that people typically want, such as weekly and seasonal totals by team and player. The foregoing seems pretty complex just to get total passing yards for a season. |
Thanks for the response. The numbers are a little off and for some reason I am getting two records for DEN with the above code. Have you found a better way to list total season stats? Thanks. |
Looking for help listing total passing yards for each team from the 2015 season. I tried this but the numbers are a little off:
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2015, season_type='Regular')
plays = q.as_plays()
passyds = []
aggregated = nfldb.aggregate(plays) # Returns a list of PlayPlayer objects.
aggregated = sorted(aggregated, key=lambda p: p.passing_yds, reverse=True)
for pp in aggregated[0:32]:
passyds.append({'Team':pp.team, 'Passing Yards': pp.passing_yds})
passyds = pd.DataFrame(passyds)
print passyds
Thanks!
The text was updated successfully, but these errors were encountered: