
Locate pitchf/x data from the Kershaw no-hitter on MLB gameday, import it into a pandas dataframe with Python, and plot pitches against the official strike zone to reveal count-based trends.
Demonstrates representing pitch location on a 2d front-of-plate plane within the strike zone, using a 5 by 4 foot chart and pitchf/x x and z coordinates from the catcher's view.
Finds and uses Excel files for MLB gameday data, with an alternative download link provided due to site instability; follow the XML addendum to access the required files.
Explore pitch effects data from MLB Gameday, drill into the 2014-06-18 game, inspect innings, at bats, pitches, spin rates, and the PX and peasy coordinates using Python.
learn to code in Python 3 using a Jupyter notebook to interactively run cells, embed visualizations and narrative text, and wrangle MLB Statcast pitch data with reusable notebook workflows.
Install Jupiter notebook, open a command line, change to your project folder, and run Jupiter notebook to start the web server and access the notebook via the url.
Launch a Python 3 Jupyter notebook, create markdown headings, use shift enter and control enter shortcuts, and track the order of execution while printing variables.
Explore how Jupyter notebooks support rich documentation through markdown, LaTeX equations, video embeds, and code blocks to convey scientific context in programming notes.
Import and configure essential Python libraries for MLB Pitchf/x data wrangling, including requests, xml.etree, pandas, and matplotlib inline plotting, with colored console output via termcolor.
Access Excel files for MLB gameday data via an alternative link when the gameday site is unstable, enabling you to wrangle Pitchf/x data with Python.
Read MLB pitchf/x data from a game, build a players dictionary from their feed URLs, fetch data with requests, and write it to a local excel file.
Parse major league baseball pitchfx xml with ElementTree to navigate game, teams, and players, then create a Python dictionary mapping each player's ID to their full name.
Learn to fetch innings and pitch data from pitchf/x using Python, parse the game xml, and navigate innings, top/bottom frames, at bats, and pitches for analysis.
Learn to wrangle major league baseball pitchf/x data with python by iterating innings and frames, extracting at-bat pitches, mapping pitch types like fc to cutter, and printing verbose colored output.
Parse each pitch in an at bat from pitchf/x data with Python, identify the pitch type, and maintain a running total of pitches while printing a verbose, color-coded display.
Convert each pitch to an XML element tree and capture at-bat events and dispositions, then cast the results into a pandas DataFrame for plotting pitches in the x-z strike zone.
Coerce nested pitch data into a pandas data frame, producing one row per pitch with batter, at-bat index, stand side, speed, and location for efficient bat-by-bat analysis.
Learn how to build and populate a pandas data frame for pitch data, including top and bottom frame counts, inning, speed, and description, and verify results with head.
Wrangle MLB pitchf/x data in Python by building a data frame, inspecting types, and plotting line and scatter visuals of pitch speed by index, with color-coding and type casting.
Use data frame slices to inspect mlb pitch data, applying non-inclusive ranges and at bat or batter filters to pull targeted rows and pitches.
Learn to plot the baseball strike zone in Python using a MATLAB-like plotting library, creating a figure and axes, and drawing the strike zone and expanded ball area with patches.
Chart pitches against the strike zone by plotting called strikes and balls for right- and left-handed batters, using a Python workflow with data frames, color dictionaries, and markers.
Chart Kershaw's balls and strikes by right- and left-handed batters using Python, plotting pitch locations relative to the strike zone with handedness annotations.
Filter the pitch data frame to Dickerson's first at bat and plot the six pitches against the strike zone, then iterate plots in a notebook with one line of code.
Label pitches in a Python notebook by filtering to a specific at-bat, plot location with strike zone, and add inline text and legend for four-seam fastball and slider.
Build a color and marker dictionary for pitch codes, plot pitches with distinct markers, and create a legend to clearly differentiate curveballs, sliders, and fastballs.
Add ball and strike count columns to the pitch data frame with Python, initialize at 0-0, and update counts per pitch for each at-bat using ball, foul, and strike events.
Plot Kershaw’s pitch tendencies by count with 12 pie-chart plots, using data frames to show pitch-type frequencies (fastball at 0-0, slider about 10%, four-seamer when ahead).
We pulled 257 pitches from Kershaw's no-hitter into a Jupiter notebook, wrangled from Excel to a data frame, and plotted pitch locations and tendencies.
Discover how pitchf/x data and spin rate analytics reshape baseball strategy, from pitcher adjustments to player development, using public data and video analysis to measure kinetic chain impact.
In the 2006 playoffs, Major League Baseball debuted a pitch tracking camera system called PitchF/x. Now installed in every MLB stadium, the system has been continually extended and re-branded. From cameras to TrackMan radar, from StatCast, to GameDay – MLB now tracks every pitch and every player's movement on each pitch. The data are made public on the MLB web site and SaberMetricians world-wide pour over every detail. The teams themselves, average five or more statisticians dedicated to analyzing the data to aid in selecting and improving players.
I'm Chaz Henry – a software engineer, 12 year little league coach and founder of the PowerChalk dot com website. In this class, we're going to open a fresh Jupyter Notebook, grab the MLB game data from Clayton Kershaw's 2014 no-hitter and wrangle that data in Python. It's an introduction in SaberMetrics - the empirical study of baseball statistics.
We'll use built-in Python libraries and graph the pitches with MatPlotLib and PyPlot. Along the way we'll talk about best practices for Jupyter Notebook, Python coding, XML parsing and maybe a little baseball.
So, if you're a coder, a SaberMetrician or a just a baseball fan who wants to peek behind the curtain at what's driving MoneyBall and the next wave of player development, sign up for the course and let's start scrubbing the pitch data from one of the greatest pitching performances in MLB history.