Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Off-by-1 bug in total_home_score and total_away_score #300

Closed
alecglen opened this issue Oct 31, 2021 · 1 comment · Fixed by #302
Closed

Off-by-1 bug in total_home_score and total_away_score #300

alecglen opened this issue Oct 31, 2021 · 1 comment · Fixed by #302
Labels
documentation Improvements or additions to documentation

Comments

@alecglen
Copy link
Member

The field definitions for total_home_score and total_away_score state that they should contain the scores as of the beginning of the play.

Instead, comparison to the fields posteam_score and defteam_score shows that they actually contain the scores as of the end of the play. (Please pardon the lack of of reprex, I'm not an R user.)

play_by_play.loc[
    play_by_play['game_id'] == '2021_01_ARI_TEN',
    [
        'play_id', 'desc', 'posteam', 'posteam_type', 'sp', 'total_home_score', 'total_away_score',
        'posteam_score', 'defteam_score', 'posteam_score_post', 'defteam_score_post'
    ]
].iloc[14:30]

image

@mrcaseb
Copy link
Member

mrcaseb commented Oct 31, 2021

Looks like a documentation bug inherited from nflscrapR. These variables are supposed to be post play as far as I can remember.

@mrcaseb mrcaseb added the documentation Improvements or additions to documentation label Nov 1, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants