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

free throw that shouldn't exist #47

Open
shengkelong opened this issue Sep 2, 2022 · 5 comments
Open

free throw that shouldn't exist #47

shengkelong opened this issue Sep 2, 2022 · 5 comments

Comments

@shengkelong
Copy link

shengkelong commented Sep 2, 2022

I use this code to count the free throws for each posessions, but every season there is a small number of cases where in this

posession offensive team has 0 points but has free throws. I don't know if it's a code problem or a data problem:

   if isinstance(p, enhanced_pbp.stats_nba.free_throw.StatsFreeThrow):
        current_players = np.sort(p.current_players[team_id_o])
        self.FTA[-1][current_players==p.player1_id]+=1
        if p.is_made:
            self.FTM[-1][current_players==p.player1_id]+=1
@dblackrun
Copy link
Owner

Do you have an example of where this happens? Game Id and possession/event number?

@shengkelong
Copy link
Author

@dblackrun There are many examples(so I think it's my code's problem) for example gameid = 0020000017,0020000019,0020000020,0020000022
in these game most of the possessions the score can fit the number of FG3M3+FG2M2+FTM, except one possession.

This is the difference between the actual points and the points calculated from the shot during the game 0020000017
image

@dblackrun
Copy link
Owner

Can you be more specific? Without a game id and possession number or event number there is no way I can look into it.

@shengkelong
Copy link
Author

shengkelong commented Sep 3, 2022

@dblackrun I think I find the possession number.
a small part of them:
<Possession GameId: 0020000017, Period: 2, Number: 25, StartTime: 6:24, EndTime: 6:08, OffenseTeamId: 1610612766>
<Possession GameId: 0020000019, Period: 3, Number: 23, StartTime: 5:47, EndTime: 5:28, OffenseTeamId: 1610612762>
<Possession GameId: 0020000019, Period: 4, Number: 41, StartTime: 1:33, EndTime: 1:20, OffenseTeamId: 1610612747>
<Possession GameId: 0020000020, Period: 3, Number: 20, StartTime: 7:18, EndTime: 6:52, OffenseTeamId: 1610612760>

Since I'm a new nba audience, I don't know the rules very well, is there such a situation that the defense team makes a free throw due to a foul by the offense team but does not exchange the ball. I notice that in Game 0020000017 UTA made a freethrow in when LAL is the offense team.

@dblackrun
Copy link
Owner

I'm guessing your issue is how you are dealing with technical free throws. There is no change of possession, so the free throw from the technical foul can be shot by either the team on offence or defence, depending on who had the ball when the technical foul was called.

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