derek-adair/nfldb

All teams seem to be "UNK"

derek-adair opened this issue · 4 comments

This used to work:

import nfldb

db = nfldb.connect()
q = nfldb.Query(db)

q.game(season_year=2012, season_type='Regular')
for pp in q.sort('passing_yds').limit(5).as_aggregate():
    print ( pp.player, pp.passing_yds )

Expected Output:

Drew Brees (UNK, UNK) 4952                                                                                            │
Andrew Luck (UNK, UNK) 4761                                                                                           │
Peyton Manning (UNK, UNK) 4727                                                                                        │
Matt Ryan (UNK, UNK) 4694                                                                                             │
Ben Roethlisberger (UNK, UNK) 4659

I think i corrupted the old database when pulling in the new . I will be giving this another shot.

This exists even in the previous db linked in the wiki;

>>> for pp in q.sort('passing_yds').as_aggregate():
...     print (pp.player, pp.passing_yds)
...
Drew Brees (NO, QB) 5177
Matthew Stafford (DET, QB) 4965
Tony Romo (DAL, QB) 4903
Tom Brady (NE, QB) 4799
Matt Ryan (ATL, QB) 4719
Peyton Manning (UNK, UNK) 4667
.... more rows w/ teams
Matt Hasselbeck (UNK, UNK) 1361                                                                                                                                                                                                              Kevin Kolb (UNK, UNK) 1169                                                                                                                                                                                                                   Brady Quinn (UNK, UNK) 1141                                                                                                                                                                                                                  John Skelton (UNK, UNK) 1132                                                                                                                                                                                                                 Ryan Lindley (UNK, UNK) 752                                                                                                                                                                                                                  Charlie Batch (UNK, UNK) 475 

I suspect it has something to do w/ team.py and how it interacts w/ nflgame. This is more evidence some refactoring of how team data is stored in this project.

This is expected behavior. Any player not on a team is classified as "UNK".

...but something has happened with nfldb-update. Everyone is UNK.

Resolved w/ new database and published in release#1.0.0a4