From 55b1fac05bd2f1c5dd039a21d42fda4f053ec294 Mon Sep 17 00:00:00 2001 From: Brandon Michaud <113574369+Brandon-Michaud@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:58:32 -0500 Subject: [PATCH] Fixed problem mentioned in issue #11 Original code had issue when no subs were made in a period it would not find the starters for that period. This one-line change fixes the issue --- play_by_play_parser/players_on_court.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play_by_play_parser/players_on_court.py b/play_by_play_parser/players_on_court.py index e8f987b..bbbb2b1 100644 --- a/play_by_play_parser/players_on_court.py +++ b/play_by_play_parser/players_on_court.py @@ -89,7 +89,7 @@ def extract_data(url): players_subbed_in_at_each_period = first_event_of_period[first_event_of_period['SUB'] == 'IN'][ ['PLAYER_ID', 'PERIOD', 'SUB']] -periods = players_subbed_in_at_each_period['PERIOD'].drop_duplicates().values.tolist() +periods = play_by_play['PERIOD'].drop_duplicates().values.tolist() rows = [] for period in periods: