-
Notifications
You must be signed in to change notification settings - Fork 100
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
Jacksonville 3 Letter Abbreviation #35
Comments
That code doesn't run...how is it supposed to show your issue? :P
This is another case where we can't control what the NFL gives us. Case in point: import nflgame
for year in range(2009, 2019):
for abbreviation in ['JAC', 'JAX']:
try:
games = nflgame.games(year, week=1, kind='REG', home=abbreviation, away=abbreviation)
for game in games:
print year, game
except TypeError:
continue
I do notice that at some pont I must have changed my teams = [
...
['JAX', 'Jacksonville', 'Jaguars', 'Jacksonville Jaguars', 'JAC'],
... but I don't think that should matter. since using the nflTeams = nflgame.teams
#teams is a list of full names I read in from a file earlier in the code, names include "Jacksonville" and "New England"
for team in teams:
# Loop through all NFL teams i.e. all 32 teams
for nflTeam in nflTeams:
# Check if this NFL team is our fantasy team
if team == nflTeam[1]:
# We have found our team, now loop through all
# games since games use team abbreviations
for game in week:
# Here nflTeam[0] will have "JAC" and game.away or game.home will have "JAX"
if nflTeam[0] == nflgame.standard_team(game.away):
# Some code here...
elif nflTeam[0] == nflgame.standard_team(game.home):
# More code here... |
I'm encountering a similar problem updating a (new) nfldb database with this fork of nflgame. Running
I'd rather not fidget with the nfldb code; is there a quick-fix I can do on the nflgame side to re-write the JSON data to play nicely with the database? |
Ya... this threw me for a loop when i first got into this project. I think it is a valid point to have something check all abbreviations and return a normalized and consistent format. As for how this affects nfldb really not sure how to advise you there. |
Closing as a known issue with a acceptable workaround. Workaround: handle it manually
This is very likely to change and/or go away when we start work on #46. |
So I have a script that uses a team's full name (i.e. Jacksonville) and grabs it's 3 letter abbreviation. For Jacksonville, this returns JAC, but the games use JAX which means I can never find Jacksonville in a game. Here is some relevant code showing my issue.
So should both of these use JAX or JAC and not one and the other?
The text was updated successfully, but these errors were encountered: