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

Player Name Error #214

Open
ghost opened this issue Dec 2, 2016 · 3 comments
Open

Player Name Error #214

ghost opened this issue Dec 2, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 2, 2016

It has to do with the extra "," in the name. Does anyone know a good way to work around that per chance?

Could not get player info from roster row:

72 Leno, Charles, Jr. T ACT 6'3" 305 10/9/1991 3 Boise State

Exception:

Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\nflgame\update_players.py", line 419, in run
roster.append(meta_from_soup_row(team, row))
File "C:\Anaconda2\lib\site-packages\nflgame\update_players.py", line 179, in meta_from_soup_row
last_name, first_name = map(lambda s: s.strip(), name.split(','))
ValueError: too many values to unpack

@snake-plissken
Copy link

snake-plissken commented Dec 2, 2016

The split function needs the second parameter to indicate how many times to split, and in this case we only want one split:

last_name, first_name = map(lambda s: s.strip(), name.split(',', 1))

Technically, it's an issue with https://github.com/BurntSushi/nflgame/

I'm actually kind of surprised this hasn't been an issue yet. I thought there were a few players with the Jr suffix (i.e. Duke Johnson Jr, Ted Ginn Jr). Turns out it's how they are listed at http:https://www.nfl.com/players/profile, and that name does not always match what is on the back of their jerseys. Right now it looks like Charles Leno Jr is the only active player in the NFL, officially, with a Jr suffix in his name. Also, he's been playing since 2014, so did he just change his name?

Edit: It looks like his name did change, at least according to Wikipedia: https://en.wikipedia.org/w/index.php?title=Charles_Leno_Jr.&diff=next&oldid=742096818

@joeycortez42
Copy link

@snake-plissken You should probably make a pull request for that fix. It worked for me.

@ghost
Copy link

ghost commented Dec 17, 2016

@nokemono42 Sorry I'm new to GitHub.
I see someone issued a pull request for the fix. How do I get that branch?

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