dcayton commited on
Commit
4144c8e
1 Parent(s): df33357

fix float error

Browse files
Files changed (1) hide show
  1. nba_tracking_data_15_16.py +2 -2
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