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

Update update_players.py #224

Closed
wants to merge 1 commit into from

Conversation

greatdansby
Copy link

Limited player name split to 1 comma, so an error doesn't occur for players with 2 commas. (Ex. Smith, John, Jr.)

Limited player name split to 1 comma, so an error doesn't occur for players with 2 commas. (Ex. Smith, John, Jr.)
@leighlondon
Copy link
Contributor

Wouldn't this render their full name as "John, Jr. Smith"?

@greatdansby
Copy link
Author

Yea, it's pretty inelegant, but it prevents an error around a data-point that (I believe) is only used for display. Unfortunately NFL.com isn't consistent with their commas (see Odell Beckham vs. Jame Wilder vs. Gerald Dixon). Maybe anything after the 2nd comma should be dropped altogether?

@ochawkeye
Copy link
Contributor

Maybe anything after the 2nd comma should be dropped altogether?

I have to agree that solution would be more elegant than having a player like `Dixon, Gerald, Jr." end up with a first name like "Gerald, Jr.".

Can either capture only the first and second items:

last_name, first_name = map(lambda s: s.strip(), name.split(','))[:2]

Alternatively, could capture everything. Would work just fine with the code today but the full name assembling could be updated to handle these additional groups of items.

(last_name, first_name), more_name = map(lambda s: s.strip(), name.split(','))[:2], map(lambda s: s.strip(), name.split(','))[2:]

@BurntSushi
Copy link
Owner

I'm not seeing this error when running the update players script.

@ochawkeye
Copy link
Contributor

This one was legit, but the last offender Gerald Dixon, Jr. seems to have been cleaned up on NFL.com in the past two weeks with a name "change" to Gerald Dixon Jr.

Don't know if it was causing problems on the NFL side which triggered the change or not. But I think it's probably fair to anticipate inconsistencies in the future.

@BurntSushi
Copy link
Owner

Yeah, the player data tends to go through a rough patch in the offseason.

I'm going to close this for now and hopefully I'll be more on top of things the next time this happens.

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

Successfully merging this pull request may close these issues.

None yet

4 participants