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

Inconsistent Turnover Data #280

Closed
joeycortez42 opened this issue Oct 29, 2017 · 2 comments
Closed

Inconsistent Turnover Data #280

joeycortez42 opened this issue Oct 29, 2017 · 2 comments

Comments

@joeycortez42
Copy link

Turnovers in nflgame and nfldb are a mess.

Sometimes the NFL's JSON data for team stats reports total turnovers and sometimes it reports "net turnovers" (i.e. fumbles lost only). nfldb's game table is supposed to be taking nflgame ['stats']['team']['trnovr'] but for some reason those are not matching either. The mappings in pull request #197 look right so the I'm not sure where the error occurs.

Turnovers should probably be an aggregate of INTs + Lost fumbles. That way game turnovers can be used to calculate team turnover differential. Individual player fumbles can always be determined on a player level.

@joeycortez42
Copy link
Author

joeycortez42 commented Oct 31, 2017

Tested a version of pull request #197 and it works. nfldb games now reports the proper turnover totals.

I checked the totals for the 2017 Ravens over the first 8 weeks of 2017 to confirm using:

import nflgame
game = nflgame.one(2017, 1, 'CIN', 'BAL')
print game.home, game.stats_home.turnovers, 'turnovers'
print game.away, game.stats_away.turnovers, 'turnovers'

for p in game.players:
	if p.fumbles_lost > 0 or p.passing_ints > 0:
		print p, p.fumbles_lost, 'fumbles lost', p.passing_ints, 'ints'

@joeycortez42
Copy link
Author

#281 is a refresh of #197 and solves the turnover data issue.

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

1 participant