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

New nfldb database #269

Open
mrg1999 opened this issue Sep 15, 2017 · 11 comments
Open

New nfldb database #269

mrg1999 opened this issue Sep 15, 2017 · 11 comments

Comments

@mrg1999
Copy link

mrg1999 commented Sep 15, 2017

In trying to overcome the SD/ LAC change, I think I corrupted my database...LAC is now occurring in every pos_team value that I believe was originally UNK (in the play table). game table may have been corrupted as well.
Is it possible to download a new database without re-installing everything from the beginning?

@mrg1999
Copy link
Author

mrg1999 commented Sep 17, 2017

Some weird things happening with nfldb (this is after running nfldb-update):

SELECT week, home_team, away_team;
FROM game;
WHERE season_year = 2017 AND season_type = 'Regular' AND week = x

If I set week = 1 or 2, I get the expected results, if I set week to anything greater than the current week, there is no data.
Also, if I change season_type to Preseason, I can only get data for week 1.
Also, Preseason Week 1 and Regular Season Week 1 show the Chargers as LAC, but week 2 of the regular season shows the Chargers as UNK

Any help/suggestions greatly appreciated

@ochawkeye
Copy link
Contributor

Not a clue if this will actually work, but here is a zip of the export of my current nfldb PostgreSQL database.

http:https://blackandbrew.net/nfldbexport.zip

I created it with pg_dump found in my PostgreSQL directory.
https://www.a2hosting.com/kb/developer-corner/postgresql/import-and-export-a-postgresql-database

@mrg1999
Copy link
Author

mrg1999 commented Sep 18, 2017

I tried creating a new nfldb with your file with no luck. I wound up uninstalling and then re-installing postgreSQL (which did create a new nfldb database). I then ran nfldb-update with no errors, however I still have nothing in the game table past the current week and no preseason stats (everything is there from years prior).
I going to re-try uploading your database.
Thanks for your help!

@mrg1999
Copy link
Author

mrg1999 commented Sep 19, 2017

The documentation you provided states I need to create the db before I can import your data.
Trying to just create the db is causing all kinds of problems with user ID, passwords, permissions etc.
This is very frustrating that I can't simply import the complete schedule for 2017. I saved a copy of my python27 and PostgreSQL folders on a thumb drive and will delete everything and start over. If this doesn't work, I'm at a complete loss.
I spent the better part of 8 or 9 months developing an excel program that imports the data and manipulates it into charts and reports that have been successful in predicting the outcome of future games. It has worked very well for the past two seasons but the program is hanging up this year simply because I can't successfully import the full schedule for 2017!

@ochawkeye
Copy link
Contributor

ochawkeye commented Sep 19, 2017 via email

@mrg1999
Copy link
Author

mrg1999 commented Sep 19, 2017

I sincerely appreciate your help both now and in the past. I'm sure I screwed something up with LAC.
Looks like I'll have to start from the beginning (and hope I don't do that again!).
Thanks again.

@mrg1999
Copy link
Author

mrg1999 commented Sep 21, 2017

@ochawkeye
I need to ask your help once again.
I re-installed everything from the beginning, INSERTed JAX and LAC into team, ran nfldb-update, ran update_sched.py --year 2017, and nfldb-update again. I can now extract the complete 2017 schedule (yeah), however LAC shows up as UNK (and only LAC) in every game in the game table.
I'm afraid to make any further changes at this point because this is where I ran into trouble last time.
It appears to be similar to the STL / LA problem last year rather than the JAX / JAC problem. In that instance, I just replaced UNK with LA when I imported it into my excel program.
I'm just wondering what the effect will be when I import scores and stats from the drive, play and play_player tables.
As always, your help is greatly appreciated.

@ochawkeye
Copy link
Contributor

ochawkeye commented Sep 21, 2017

Have a look at the second to last post in #252. Adding LAC line in nfldb\team.py might just be what you're missing to get nfldb to recognize "LAC" as a legit team.

@mrg1999
Copy link
Author

mrg1999 commented Sep 21, 2017

Worked like a charm!
I'm putting you in my will !!!

@mrg1999
Copy link
Author

mrg1999 commented Sep 22, 2017

LAC showing up as UNK in the play_player table:
I noticed when I queried the play_player table for stats i.e. passing_yds or receiving_yds for LAC games, the results were all coming up as zero, so I ran the following:
SELECT team, passing_yds, receiving_yds FROM play_player WHERE gsis_id = '2017091708' (MIA-LAC week 2)
LAC shows up as UNK
Obviously, I'm a little leary about updating UNK to LAC

@ochawkeye
Copy link
Contributor

That game must have had those tables populated before you got your LAC issue ironed out. I agree that going wholesale UNK -> LAC would not be wise.

Based on #89 I believe deleting that game (DELETE FROM game WHERE gsis_id = '2017091708';) and rerunning your query would update it though I'm not 100% positive on that.

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