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

Game ID #208

Closed
mrg1999 opened this issue Oct 30, 2016 · 2 comments
Closed

Game ID #208

mrg1999 opened this issue Oct 30, 2016 · 2 comments

Comments

@mrg1999
Copy link

mrg1999 commented Oct 30, 2016

I'm trying to get the game id for each game in a particular week.
What is the correct syntax for identifying gsis_id
Thanks!

weekNum=8
s_t='Regular'
yr=2016

import csv
with open('schedule_test.csv', 'wb') as csvfile:
    import nfldb
    db = nfldb.connect()
    q = nfldb.Query(db)
    q.game(season_year=yr, season_type=s_t, week=weekNum)
    writer = csv.writer(open("C:/Python27/temp/schedule_test.csv", 'wb'))
    for game in q.as_games():
        if game.is_playing:
            writer.writerow ([game, game.finished, game.plays[-1].time])
            #print (tmp)
        else:
                writer.writerow ([game, game.finished])
        print game, game.finished, gsis_id
@joshutt
Copy link

joshutt commented Oct 30, 2016

The way you did it on the last line there should be correct, if you make it game.gsis_id. So this should give you what you are looking for:
print game, game.finished, game.gsis_id

@mrg1999
Copy link
Author

mrg1999 commented Oct 30, 2016

Perfect, Thanks

@mrg1999 mrg1999 closed this as completed Oct 30, 2016
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