Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Wrangling Major League Baseball Pitchf/x Data with Python
Highest Rated
Rating: 4.6 out of 5(53 ratings)
3,156 students

Wrangling Major League Baseball Pitchf/x Data with Python

Charting MLB GameDay - PitchF/x data using Jupyter Notebooks, Python and MatPlotLib
Created byChaz Henry
Last updated 1/2024
English

What you'll learn

  • How to find MLB game and pitch data in Gameday.
  • How to create and program a Jupyter Notebook in Python.
  • How to extract XML pitch data from the MLB website.
  • How to coerce XML tree data into a Pandas Dataframe.
  • How to extract Dataframe slices into multiple views.
  • How to plot pitch data with Matplotlib and Pyplot graphs.
  • Adding data columns to a Pandas Dataframe.
  • Plotting pitch tendency as pie charts (by ball-strike count).

Course content

6 sections30 lectures2h 41m total length
  • The Process1:04
  • The Strikezone2:00
  • XML Addendum0:29
  • Gameday - Pitchf/x Data5:53
  • Jupyter Notebook Intro3:05
  • Jupyter Notebook - Install/Run1:30
  • Jupyter Notebook - Basics2:49

    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.

  • Jupyter Notebooks - Rich Documentation2:12

    Explore how Jupyter notebooks support rich documentation through markdown, LaTeX equations, video embeds, and code blocks to convey scientific context in programming notes.

Requirements

  • Basic programming is helpful.

Description

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.

Who this course is for:

  • Beginner or intermediate Python programmers.
  • SaberMetric baseball fans.