add visitor players
Browse files- nba_tracking_data_15_16.py +10 -8
nba_tracking_data_15_16.py
CHANGED
@@ -66,13 +66,13 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
|
|
66 |
"name": datasets.Value("string"),
|
67 |
"teamid": datasets.Value("int64"),
|
68 |
"abbreviation": datasets.Value("string"),
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
},
|
77 |
# "home": {
|
78 |
# "name": datasets.Value("string"),
|
@@ -159,6 +159,7 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
|
|
159 |
visitor_name = event['visitor']['name']
|
160 |
visitor_team_id = event['visitor']['teamid']
|
161 |
visitor_abbrev = event['visitor']['abbreviation']
|
|
|
162 |
for moment in event["moments"]:
|
163 |
quarter = moment[0]
|
164 |
game_clock = moment[2]
|
@@ -185,7 +186,8 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
|
|
185 |
"visitor": {
|
186 |
"name": visitor_name,
|
187 |
"teamid": visitor_team_id,
|
188 |
-
"abbreviation": visitor_abbrev
|
|
|
189 |
},
|
190 |
"quarter": quarter,
|
191 |
"game_clock": game_clock,
|
|
|
66 |
"name": datasets.Value("string"),
|
67 |
"teamid": datasets.Value("int64"),
|
68 |
"abbreviation": datasets.Value("string"),
|
69 |
+
"players": datasets.Sequence({
|
70 |
+
"lastname": datasets.Value("string"),
|
71 |
+
"firstname": datasets.Value("string"),
|
72 |
+
"playerid": datasets.Value("int64"),
|
73 |
+
"jersey": datasets.Value("string"),
|
74 |
+
"position": datasets.Value("string")
|
75 |
+
})
|
76 |
},
|
77 |
# "home": {
|
78 |
# "name": datasets.Value("string"),
|
|
|
159 |
visitor_name = event['visitor']['name']
|
160 |
visitor_team_id = event['visitor']['teamid']
|
161 |
visitor_abbrev = event['visitor']['abbreviation']
|
162 |
+
visitor_players = event['visitor']['players']
|
163 |
for moment in event["moments"]:
|
164 |
quarter = moment[0]
|
165 |
game_clock = moment[2]
|
|
|
186 |
"visitor": {
|
187 |
"name": visitor_name,
|
188 |
"teamid": visitor_team_id,
|
189 |
+
"abbreviation": visitor_abbrev,
|
190 |
+
"players": visitor_players
|
191 |
},
|
192 |
"quarter": quarter,
|
193 |
"game_clock": game_clock,
|