You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a statcast query, there are now a number of pitches which are returned with 'pitch_type' set to what seems to be a date-string.
The easiest way to look at this is to use something like: data['pitch_type'].unique()
After a quick look, the vast majority of these pitches also return with blank fields in the following:
pfx_x, pfx_y, pfx_z
vx0, vy0, vz0, ax, ay, az
release_pos_x, release_pos_y, release_pos_z
pitch_name
However this doesn't cover all of the cases, the remainder seem normal except for a blank 'pitch_name' field - though there are plenty of pitches with blank pitch types that also return a blank 'pitch_name' field but are otherwise normal.
This is an issue on the statcast side: I've replicated the behaviour using a simple 2-day query from baseballsavant. With that in mind, this isn't really an issue with pybaseball as I don't think a cut & dry fix exists on the pybaseball end, but it's more something for people to be aware of.
For what it's worth, in case others want to remove these entries like I did, I used something like this:
mask = np.in1d(data['pitch_type'].astype(str).str[0], '1')
data = data[~mask]
Which covers you for these entries occurring across multiple years.
Thanks again for the hard work James.
Cheers,
Rens
The text was updated successfully, but these errors were encountered:
When generating a statcast query, there are now a number of pitches which are returned with
'pitch_type'
set to what seems to be a date-string.The easiest way to look at this is to use something like:
data['pitch_type'].unique()
After a quick look, the vast majority of these pitches also return with blank fields in the following:
However this doesn't cover all of the cases, the remainder seem normal except for a blank
'pitch_name'
field - though there are plenty of pitches with blank pitch types that also return a blank'pitch_name'
field but are otherwise normal.This is an issue on the statcast side: I've replicated the behaviour using a simple 2-day query from baseballsavant. With that in mind, this isn't really an issue with pybaseball as I don't think a cut & dry fix exists on the pybaseball end, but it's more something for people to be aware of.
For what it's worth, in case others want to remove these entries like I did, I used something like this:
Which covers you for these entries occurring across multiple years.
Thanks again for the hard work James.
Cheers,
Rens
The text was updated successfully, but these errors were encountered: