Skip to content
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

nfldb & nflgame data mismatch #43

Open
ochawkeye opened this issue Aug 5, 2014 · 3 comments
Open

nfldb & nflgame data mismatch #43

ochawkeye opened this issue Aug 5, 2014 · 3 comments

Comments

@ochawkeye
Copy link
Contributor

I'm finding some instances where nfldb data does not match what I would expect based on last years nflgame data. For example:

from __future__ import print_function
y, w = 2013, 7

import nflgame
games = nflgame.games(year=y, week=w, kind='REG')
players = nflgame.combine_game_stats(games)
for x in players:
    if x.name == 'R.Gould' or x.name == 'G.Gano':
        print(x.name, getattr(x, 'kicking_xpmade'))

print('-'*79)

import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=y, season_type='Regular', week=w)
q.player(full_name='Graham Gano')
for pp in q.as_aggregate():
    print(pp.player.gsis_name, getattr(pp, 'kicking_xpmade'))

q = nfldb.Query(db)
q.game(season_year=y, season_type='Regular', week=w)
q.player(full_name='Robbie Gould')
for pp in q.as_aggregate():
    print(pp.player.gsis_name, getattr(pp, 'kicking_xpmade'))

Produces the following:

G.Gano 3
R.Gould 5
-------------------------------------------------------------------------------
G.Gano 2
R.Gould 4

Where are the missing extra points? Am I simply using incorrect criteria in nfldb queries?

@BurntSushi
Copy link
Owner

nfldb is play-by-play data only. Your nflgame code is using combine_game_stats. Instead, could you try it with combine_play_stats? Hopefully this will produce equivalent results.

Regrettably, extra points are, by far, the statistic with the most volatility.

@ochawkeye
Copy link
Contributor Author

Indeed, changing to combine_play_stats gives identical results. I'm now reminded of a long ago issue reporting against nflgame on this very topic.

@ochawkeye
Copy link
Contributor Author

No strong desire to hunt down each and every discrepancy, but these are a few I stumbled across when trying to reconcile scores for week 1.

Blair Walsh (MIN, K): 4 XP made vs. 3 XP in nfldb
Cody Parkey (PHI, K): 4 XP made vs. 3 XP in nfldb
Dexter McCluster (TEN, RB): -2 punt return yards <-- (this one actually looks correct, nflgame maxed this one incorrectly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants