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

after running nfldb-update, database is missing week 1 2017 regular season data #267

Closed
BlackArbsCEO opened this issue Sep 14, 2017 · 6 comments

Comments

@BlackArbsCEO
Copy link

I've run the nfldb-update script a few times in the last couple days then, extract the game results data using the following basic query:

columns = [ 'away_score',
 'away_score_q1',
 'away_score_q2',
 'away_score_q3',
 'away_score_q4',
 'away_score_q5',
 'away_team',
 'away_turnovers',
 'day_of_week',
 'finished',
 'gamekey',
 'gsis_id',
 'home_score',
 'home_score_q1',
 'home_score_q2',
 'home_score_q3',
 'home_score_q4',
 'home_score_q5',
 'home_team',
 'home_turnovers',
 'loser',
 'season_type',
 'season_year',
 'start_time',
 'week',
 'winner']

db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=[2016, 2017], season_type='Regular')
rows = []
for g in q.as_games():
    row = [eval('g.{}'.format(v)) for v in columns]
    rows.append(row)

I create a df and save the data but when I look at it, it has all of 2016 regular season data including Jan 2017 games, and it also has week 2 2017 scheduled gamees but it is missing week 1 2017 game results.

@gaktor
Copy link

gaktor commented Sep 14, 2017

Just noticed this late yesterday as well.

Checking the database after an update, there are no 2017 preseason or week 1 games. Just the week 2 schedule.

SELECT GSIS_ID,WEEK,SEASON_YEAR,SEASON_TYPE FROM GAME WHERE SEASON_YEAR = '2017';

2017091400 2 2017 Regular
2017091700 2 2017 Regular
2017091701 2 2017 Regular
2017091702 2 2017 Regular
2017091703 2 2017 Regular
2017091704 2 2017 Regular
2017091705 2 2017 Regular
2017091706 2 2017 Regular
2017091707 2 2017 Regular
2017091708 2 2017 Regular
2017091709 2 2017 Regular
2017091710 2 2017 Regular
2017091711 2 2017 Regular
2017091712 2 2017 Regular
2017091713 2 2017 Regular
2017091800 2 2017 Regular

@ochawkeye
Copy link
Contributor

I don't seem to have this problem.

import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=[2016, 2017], season_type='Regular')
rows = []
for game in q.sort(('gsis_id', 'asc')).as_games():
    print game
Regular 2016 week 1 on 09/08 at 07:30PM, CAR (20) at DEN (21)
.
.
.
Regular 2016 week 17 on 01/01 at 03:25PM, SEA (25) at SF (23)
Regular 2017 week 1 on 09/07 at 07:30PM, KC (42) at NE (27)
.
.
.
Regular 2017 week 17 on 12/31 at 03:25PM, ARI (0) at SEA (0)
[Finished in 0.3s]

Can you try updating your schedule with nflgame-update-schedule script and --year 2017 flag?

@BlackArbsCEO
Copy link
Author

BlackArbsCEO commented Sep 14, 2017

I'm getting a command not found for nflgame-update-schedule --year 2017, attempting to run the script on Ubuntu 16.04 in the terminal. Should I execute this command using a different method?

Here are the nfldb and nflgame package versions:

nfldb                     0.2.17                    <pip>
nflgame                   1.2.20                    <pip>

@ochawkeye
Copy link
Contributor

Huh, looks like only the nflgame-update-players script comes down during install and not the nflgame-update-schedule. No matter...that script just runs nflgame.update_sched.run()

You can run it directly with .../nflgame/update_schedule.py --year 2017 from your site-packages location instead.

@BlackArbsCEO
Copy link
Author

thanks for the help. After running the update schedule script directly with the 2017 flag, I used the nfldb-update-script.sh found here #194 and it was able to add the data to the db.

@gaktor
Copy link

gaktor commented Sep 14, 2017

Thanks! That did the trick.

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

3 participants