File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ def _add_dribbles(actions: pd.DataFrame) -> pd.DataFrame:
4242 not_offensive_foul = same_team & (
4343 next_actions .type_id != spadlconfig .actiontypes .index ('foul' )
4444 )
45+ not_headed_shot = (next_actions .type_id != spadlconfig .actiontypes .index ('shot' )) & (
46+ next_actions .bodypart_id != spadlconfig .bodyparts .index ('head' )
47+ )
4548
4649 dx = actions .end_x - next_actions .start_x
4750 dy = actions .end_y - next_actions .start_y
@@ -53,7 +56,13 @@ def _add_dribbles(actions: pd.DataFrame) -> pd.DataFrame:
5356 same_period = actions .period_id == next_actions .period_id
5457
5558 dribble_idx = (
56- same_team & far_enough & not_too_far & same_phase & same_period & not_offensive_foul
59+ same_team
60+ & far_enough
61+ & not_too_far
62+ & same_phase
63+ & same_period
64+ & not_offensive_foul
65+ & not_headed_shot
5766 )
5867
5968 dribbles = pd .DataFrame ()
You can’t perform that action at this time.
0 commit comments