try new structure
Browse files- nba_tracking_data_15_16.py +20 -20
nba_tracking_data_15_16.py
CHANGED
@@ -160,24 +160,24 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
|
|
160 |
quarter = moment[0]
|
161 |
game_clock = moment[2]
|
162 |
shot_clock = moment[3]
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
160 |
quarter = moment[0]
|
161 |
game_clock = moment[2]
|
162 |
shot_clock = moment[3]
|
163 |
+
ball_coords = moment[5][0][2:]
|
164 |
+
for player in moment[5][1:]:
|
165 |
+
team_id = player[0]
|
166 |
+
player_id = player[1]
|
167 |
+
x = player[2]
|
168 |
+
y = player[3]
|
169 |
+
z = player[4]
|
170 |
|
171 |
+
moment_id += 1
|
172 |
+
# moment_id stop
|
173 |
+
if moment_id > 1000:
|
174 |
+
break
|
175 |
+
|
176 |
+
yield moment_id, {
|
177 |
+
"gameid": game_id,
|
178 |
+
"gamedate": game_date,
|
179 |
+
"eventid": event_id,
|
180 |
+
"quarter": quarter,
|
181 |
+
"game_clock": game_clock,
|
182 |
+
"shot_clock": shot_clock
|
183 |
+
}
|