Today I was doing some pitch analysis for the Mexican Winter league and I found some pitches having the same event ids, although every pitch should have a not null, unique, event id. Below are the duplicate pitching events I found for the Liga Mexicana del Pacífico:
game event_num ocurrences no_of_atbat no_of_poti no_of_innings
gid_2016_10_19_herwin_mazwin_1 320 2 2 2 1
gid_2016_10_22_mxcwin_navwin_1 113 2 2 1 1
gid_2016_10_22_mxcwin_navwin_1 114 2 2 1 1
gid_2016_10_25_mocwin_obrwin_1 131 2 2 1 1
gid_2016_10_25_mocwin_obrwin_1 132 2 2 1 1
gid_2016_10_25_mocwin_obrwin_1 135 2 2 1 1
gid_2016_10_25_mocwin_obrwin_1 141 2 2 1 1
gid_2016_11_09_navwin_mocwin_1 761 2 2 1 1
gid_2017_10_27_herwin_mocwin_1 709 2 2 1 1
From this data we are able to see that a pitching event may appear in different at bats and different parts of the inning. Moreover we can corroborate that pitches having the same pitching event id will store the same exact data. Just take a close look at lines 3 and 9 of below’s Gameday XML file. They are exactly the same! So you better consider this bug in your code or you might end up granting strikes and balls to batters that don’t deserve them !
<atbat num="41" b="0" s="1" o="3" start_tfs="032621" start_tfs_zulu="2016-10-20T03:26:21Z" batter="471679" stand="R" b_height="5-10" pitcher="452168" p_throws="R" des="Carlos Alberto Gastelum grounds into a force out, shortstop Paul Leon to second baseman Esteban Quiroz. Jose Aguilar out at 2nd. " des_es="Carlos Alberto Gastelum batea rodado batea para out forzado, campo corto Paul Leon a segunda base Esteban Quiroz. Jose Aguilar a cabo a 2da. " event_num="323" event="Forceout" event_es="Out Forzado" home_team_runs="1" away_team_runs="7"> | |
<pitch des="Called Strike" des_es="Strike cantado" id="319" type="S" tfs="032705" tfs_zulu="2016-10-20T03:27:05Z" x="119.7394105697219" y="138.43399608865712" event_num="319" on_1b="591572" sz_top="3.38" sz_bot="1.5" cc="" mt=""/> | |
<pitch des="In play, out(s)" des_es="En juego, out(s)" id="320" type="X" tfs="032819" tfs_zulu="2016-10-20T03:28:19Z" x="107.45051696431274" y="148.34191655801826" event_num="320" on_1b="591572" sz_top="3.38" sz_bot="1.5" cc="" mt=""/> | |
<runner id="591572" start="1B" end="" event="Forceout" event_num="323"/> | |
</atbat> | |
</top> | |
<bottom> | |
<atbat num="42" b="3" s="2" o="1" start_tfs="032705" start_tfs_zulu="2016-10-20T03:27:05Z" batter="608608" stand="L" b_height="5-11" pitcher="517062" p_throws="L" des="Carlos Munoz grounds out, shortstop Jorge Flores to first baseman Efren Navarro. " des_es="Carlos Munoz batea rodado de out, campo corto Jorge Flores a primera base Efren Navarro. " event_num="333" event="Groundout" event_es="Roletazo de Out" home_team_runs="1" away_team_runs="7"> | |
<pitch des="In play, out(s)" des_es="En juego, out(s)" id="320" type="X" tfs="032819" tfs_zulu="2016-10-20T03:28:19Z" x="107.45051696431274" y="148.34191655801826" event_num="320" on_1b="591572" sz_top="3.38" sz_bot="1.5" cc="" mt=""/> | |
<runner id="591572" start="1B" end="" event="Groundout" event_num="333"/> | |
<pitch des="Ball" des_es="Bola mala" id="326" type="B" tfs="032958" tfs_zulu="2016-10-20T03:29:58Z" x="117.5449652830417" y="212.50749674054762" event_num="326" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
<pitch des="Called Strike" des_es="Strike cantado" id="327" type="S" tfs="033005" tfs_zulu="2016-10-20T03:30:05Z" x="105.69496073496857" y="166.74234028683182" event_num="327" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
<pitch des="Ball" des_es="Bola mala" id="328" type="B" tfs="033018" tfs_zulu="2016-10-20T03:30:18Z" x="121.49496679906609" y="91.72522816166885" event_num="328" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
<pitch des="Called Strike" des_es="Strike cantado" id="329" type="S" tfs="033032" tfs_zulu="2016-10-20T03:30:32Z" x="126.32274642976253" y="128.9978813559322" event_num="329" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
<pitch des="Ball" des_es="Bola mala" id="330" type="B" tfs="033048" tfs_zulu="2016-10-20T03:30:48Z" x="74.97272672144562" y="150.22913950456322" event_num="330" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
<pitch des="In play, out(s)" des_es="En juego, out(s)" id="331" type="X" tfs="033116" tfs_zulu="2016-10-20T03:31:16Z" x="111.83940753767315" y="127.58246414602348" event_num="331" sz_top="3.319" sz_bot="1.513" cc="" mt=""/> | |
</atbat> |