fix float error
Browse files
nba_tracking_data_15_16.py
CHANGED
@@ -65,9 +65,9 @@ def identify_offense(row):
|
|
65 |
identified_offense_events = [1, 2, 3, 4, 5]
|
66 |
if int(row['EVENTMSGTYPE'].item()) in identified_offense_events:
|
67 |
poss_team_id = int(row['PLAYER1_TEAM_ID'].item())
|
68 |
-
elif ("OFF.FOUL" in row["HOMEDESCRIPTION"].item()) or ("OFF.FOUL" in row["VISITORDESCRIPTION"].item()):
|
69 |
poss_team_id = int(row['PLAYER1_TEAM_ID'].item())
|
70 |
-
elif row['EVENTMSGTYPE'] == 6:
|
71 |
poss_team_id = int(row['PLAYER2_TEAM_ID'].item())
|
72 |
else:
|
73 |
poss_team_id = None
|
|
|
65 |
identified_offense_events = [1, 2, 3, 4, 5]
|
66 |
if int(row['EVENTMSGTYPE'].item()) in identified_offense_events:
|
67 |
poss_team_id = int(row['PLAYER1_TEAM_ID'].item())
|
68 |
+
elif ("OFF.FOUL" in str(row["HOMEDESCRIPTION"].item())) or ("OFF.FOUL" in str(row["VISITORDESCRIPTION"].item())):
|
69 |
poss_team_id = int(row['PLAYER1_TEAM_ID'].item())
|
70 |
+
elif int(row['EVENTMSGTYPE'].item()) == 6:
|
71 |
poss_team_id = int(row['PLAYER2_TEAM_ID'].item())
|
72 |
else:
|
73 |
poss_team_id = None
|