Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pitch type is broken on statcast side #47

Closed
rensmacneill opened this issue Mar 20, 2019 · 1 comment
Closed

Pitch type is broken on statcast side #47

rensmacneill opened this issue Mar 20, 2019 · 1 comment

Comments

@rensmacneill
Copy link

rensmacneill commented Mar 20, 2019

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

@rensmacneill
Copy link
Author

rensmacneill commented Mar 20, 2019

I have contacted the statcast guys and they are investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant