-
Notifications
You must be signed in to change notification settings - Fork 263
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
Accessing the Game Clock #200
Comments
Precisely. You could take advantage of import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2016, season_type='Regular', week=5)
for game in q.as_games():
print game, game.finished
if game.is_playing:
print game.plays[-1].time
(Obviously not a great time to run this example since there aren't actually any game being played at the moment) |
Thank you! |
I'm trying to get the current quarter and clock for games that are in progress. I have the following code:
I get the following error:
Traceback (most recent call last):
File "pc.py", line 9, in
p_c = game.plays[-1].time
IndexError: list index out of range_
If I change the finished parameter to 'true' I get the list of all final games without an error but of course I don't need the quarter and time for a game that is already final.
Am I getting this error because the only game that isn't finished hasn't started yet?
The text was updated successfully, but these errors were encountered: