File size: 7,881 Bytes
ac5d6cc
b630768
 
 
 
 
 
 
 
 
 
 
 
fae10e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac5d6cc
b630768
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
---
license: mit
task_categories:
- other
language:
- en
tags:
- baseball
- mlb
- statcast
- sports-analytics
size_categories:
- 100K<n<1M
dataset_info:
  features:
  - name: pitch_type
    dtype: string
  - name: game_date
    dtype: string
  - name: release_speed
    dtype: float64
  - name: release_pos_x
    dtype: float64
  - name: release_pos_z
    dtype: float64
  - name: player_name
    dtype: string
  - name: batter
    dtype: int64
  - name: pitcher
    dtype: int64
  - name: events
    dtype: string
  - name: description
    dtype: string
  - name: spin_dir
    dtype: int64
  - name: spin_rate_deprecated
    dtype: int64
  - name: break_angle_deprecated
    dtype: int64
  - name: break_length_deprecated
    dtype: int64
  - name: zone
    dtype: int64
  - name: des
    dtype: string
  - name: game_type
    dtype: string
  - name: stand
    dtype: string
  - name: p_throws
    dtype: string
  - name: home_team
    dtype: string
  - name: away_team
    dtype: string
  - name: type
    dtype: string
  - name: hit_location
    dtype: int64
  - name: bb_type
    dtype: string
  - name: balls
    dtype: int64
  - name: strikes
    dtype: int64
  - name: game_year
    dtype: int64
  - name: pfx_x
    dtype: float64
  - name: pfx_z
    dtype: float64
  - name: plate_x
    dtype: float64
  - name: plate_z
    dtype: float64
  - name: on_3b
    dtype: int64
  - name: on_2b
    dtype: int64
  - name: on_1b
    dtype: int64
  - name: outs_when_up
    dtype: int64
  - name: inning
    dtype: int64
  - name: inning_topbot
    dtype: string
  - name: hc_x
    dtype: float64
  - name: hc_y
    dtype: float64
  - name: tfs_deprecated
    dtype: int64
  - name: tfs_zulu_deprecated
    dtype: int64
  - name: umpire
    dtype: int64
  - name: sv_id
    dtype: int64
  - name: vx0
    dtype: float64
  - name: vy0
    dtype: float64
  - name: vz0
    dtype: float64
  - name: ax
    dtype: float64
  - name: ay
    dtype: float64
  - name: az
    dtype: float64
  - name: sz_top
    dtype: float64
  - name: sz_bot
    dtype: float64
  - name: hit_distance_sc
    dtype: int64
  - name: launch_speed
    dtype: float64
  - name: launch_angle
    dtype: int64
  - name: effective_speed
    dtype: float64
  - name: release_spin_rate
    dtype: int64
  - name: release_extension
    dtype: float64
  - name: game_pk
    dtype: int64
  - name: fielder_2
    dtype: int64
  - name: fielder_3
    dtype: int64
  - name: fielder_4
    dtype: int64
  - name: fielder_5
    dtype: int64
  - name: fielder_6
    dtype: int64
  - name: fielder_7
    dtype: int64
  - name: fielder_8
    dtype: int64
  - name: fielder_9
    dtype: int64
  - name: release_pos_y
    dtype: float64
  - name: estimated_ba_using_speedangle
    dtype: float64
  - name: estimated_woba_using_speedangle
    dtype: float64
  - name: woba_value
    dtype: float64
  - name: woba_denom
    dtype: int64
  - name: babip_value
    dtype: int64
  - name: iso_value
    dtype: int64
  - name: launch_speed_angle
    dtype: int64
  - name: at_bat_number
    dtype: int64
  - name: pitch_number
    dtype: int64
  - name: pitch_name
    dtype: string
  - name: home_score
    dtype: int64
  - name: away_score
    dtype: int64
  - name: bat_score
    dtype: int64
  - name: fld_score
    dtype: int64
  - name: post_away_score
    dtype: int64
  - name: post_home_score
    dtype: int64
  - name: post_bat_score
    dtype: int64
  - name: post_fld_score
    dtype: int64
  - name: if_fielding_alignment
    dtype: string
  - name: of_fielding_alignment
    dtype: string
  - name: spin_axis
    dtype: int64
  - name: delta_home_win_exp
    dtype: float64
  - name: delta_run_exp
    dtype: float64
  - name: bat_speed
    dtype: float64
  - name: swing_length
    dtype: float64
  - name: estimated_slg_using_speedangle
    dtype: float64
  - name: delta_pitcher_run_exp
    dtype: float64
  - name: hyper_speed
    dtype: float64
  - name: home_score_diff
    dtype: int64
  - name: bat_score_diff
    dtype: int64
  - name: home_win_exp
    dtype: float64
  - name: bat_win_exp
    dtype: float64
  - name: age_pit_legacy
    dtype: int64
  - name: age_bat_legacy
    dtype: int64
  - name: age_pit
    dtype: int64
  - name: age_bat
    dtype: int64
  - name: n_thruorder_pitcher
    dtype: int64
  - name: n_priorpa_thisgame_player_at_bat
    dtype: int64
  - name: pitcher_days_since_prev_game
    dtype: int64
  - name: batter_days_since_prev_game
    dtype: int64
  - name: pitcher_days_until_next_game
    dtype: int64
  - name: batter_days_until_next_game
    dtype: int64
  - name: api_break_z_with_gravity
    dtype: float64
  - name: api_break_x_arm
    dtype: float64
  - name: api_break_x_batter_in
    dtype: float64
  - name: arm_angle
    dtype: float64
  - name: attack_angle
    dtype: float64
  - name: attack_direction
    dtype: float64
  - name: swing_path_tilt
    dtype: float64
  - name: intercept_ball_minus_batter_pos_x_inches
    dtype: float64
  - name: intercept_ball_minus_batter_pos_y_inches
    dtype: float64
  splits:
  - name: train
    num_bytes: 1278467871
    num_examples: 1248824
  download_size: 234517903
  dataset_size: 1278467871
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

# Daily MLB Statcast Data

This dataset contains MLB Statcast data that is automatically updated daily.

## Dataset Description

- **Source**: MLB Statcast via pybaseball
- **Update Frequency**: Daily
- **Last Updated**: 2025-07-24 21:31:32
- **Repository**: jab13/daily-statcast-data

## Data Fields

The dataset includes comprehensive pitch-by-pitch data with over 80 fields including:

### Basic Information
- `game_date`, `game_pk`, `home_team`, `away_team`
- `batter`, `pitcher`, `fielder_2` through `fielder_9`
- `balls`, `strikes`, `outs_when_up`

### Pitch Data
- `pitch_type`, `pitch_name`
- `release_speed`, `effective_speed`
- `spin_rate`, `spin_axis`
- `release_pos_x`, `release_pos_y`, `release_pos_z`

### Location & Zone
- `plate_x`, `plate_z`
- `sz_top`, `sz_bot`
- `zone`

### Outcome Data
- `events`, `description`, `type`
- `hit_location`, `bb_type`
- `launch_speed`, `launch_angle`
- `hit_distance_sc`

### Advanced Metrics
- `woba_value`, `woba_denom`
- `babip_value`, `iso_value`
- `estimated_ba_using_speedangle`
- `estimated_woba_using_speedangle`

## Usage

```python
from datasets import load_dataset
import pandas as pd

# Load the dataset
dataset = load_dataset("jab13/daily-statcast-data")
df = dataset['train'].to_pandas()

# Basic analysis
print(f"Total pitches: {len(df):,}")
print(f"Date range: {df['game_date'].min()} to {df['game_date'].max()}")

# Pitch type distribution
pitch_types = df['pitch_type'].value_counts()
print("Most common pitch types:")
print(pitch_types.head())

# Exit velocity analysis
hits = df[df['launch_speed'].notna() & (df['launch_speed'] > 0)]
print(f"Average exit velocity: {hits['launch_speed'].mean():.1f} mph")
```

## Data Pipeline

This dataset is maintained by an automated pipeline that:
1. Fetches daily Statcast data using pybaseball
2. Cleans and standardizes the data format
3. Merges with existing data and removes duplicates
4. Updates the Hugging Face dataset with new information

## Data Quality

- **Deduplication**: Removes duplicate pitches based on game_pk, at_bat_number, and pitch_number
- **Standardization**: Consistent data types and null value handling
- **Validation**: Ensures data integrity before upload

## Updates

The dataset is automatically updated daily at 6 AM UTC to include the previous day's games. Updates typically include:
- All pitch-by-pitch data from completed games
- Corrected data for any previously uploaded games
- Advanced metrics and calculated fields

## License

MIT License - Data is publicly available from MLB Advanced Media.

## Attribution

Data sourced from MLB Advanced Media via the pybaseball Python package.