dcayton commited on
Commit
9203011
1 Parent(s): 79d51f9

new structure for data

Browse files
Files changed (1) hide show
  1. nba_tracking_data_15_16.py +29 -23
nba_tracking_data_15_16.py CHANGED
@@ -89,21 +89,25 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
89
  }
90
  ]
91
  },
92
- "quarter": datasets.Value("int64"),
93
- "game_clock": datasets.Value("float32"),
94
- "shot_clock": datasets.Value("float32"),
95
- "ball_coordinates": {
96
- "x": datasets.Value("float32"),
97
- "y": datasets.Value("float32"),
98
- "z": datasets.Value("float32")
99
- },
100
- "player_coordinates": [
101
  {
102
- "teamid": datasets.Value("int32"),
103
- "playerid": datasets.Value("int32"),
104
- "x": datasets.Value("float32"),
105
- "y": datasets.Value("float32"),
106
- "z": datasets.Value("float32")
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
  ]
109
  }
@@ -201,13 +205,15 @@ class NbaTracking(datasets.GeneratorBasedBuilder):
201
  "abbreviation": home_abbrev,
202
  "players": home_players
203
  },
204
- "quarter": quarter,
205
- "game_clock": game_clock,
206
- "shot_clock": shot_clock,
207
- "ball_coordinates": {
208
- "x": ball_coords_x,
209
- "y": ball_coords_y,
210
- "z": ball_coords_z
211
- },
212
- "player_coordinates": player_coords
 
 
213
  }
 
89
  }
90
  ]
91
  },
92
+ "event_details": [
 
 
 
 
 
 
 
 
93
  {
94
+ "quarter": datasets.Value("int64"),
95
+ "game_clock": datasets.Value("float32"),
96
+ "shot_clock": datasets.Value("float32"),
97
+ "ball_coordinates": {
98
+ "x": datasets.Value("float32"),
99
+ "y": datasets.Value("float32"),
100
+ "z": datasets.Value("float32")
101
+ },
102
+ "player_coordinates": [
103
+ {
104
+ "teamid": datasets.Value("int32"),
105
+ "playerid": datasets.Value("int32"),
106
+ "x": datasets.Value("float32"),
107
+ "y": datasets.Value("float32"),
108
+ "z": datasets.Value("float32")
109
+ }
110
+ ]
111
  }
112
  ]
113
  }
 
205
  "abbreviation": home_abbrev,
206
  "players": home_players
207
  },
208
+ "event_details": {
209
+ "quarter": quarter,
210
+ "game_clock": game_clock,
211
+ "shot_clock": shot_clock,
212
+ "ball_coordinates": {
213
+ "x": ball_coords_x,
214
+ "y": ball_coords_y,
215
+ "z": ball_coords_z
216
+ },
217
+ "player_coordinates": player_coords
218
+ }
219
  }