Skip to content

[Python] Interactive plots showing MLB pitch locations from Statcast using Pandas and SQLite loaded via Plotly HTML

Notifications You must be signed in to change notification settings

AaronHenry/MLB-Pitch-Locator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLB Pitch Locator

Interactive plot showing MLB pitch locations from Statcast using Pandas and SQLite, saving as HTML for viewing through plotly.

Supports both importing local Statcast .csv file and pulling data directly from Statcast using baseball_scraper.

Features:

  • Left / Right batter splits per pitch type
  • Single or multitple pitch selection
  • Pitch velocity on hover
  • Local .csv chunk import to Pandas dataframe and SQLite .db using SQLAlchemy
  • Direct pull from baseball-savant's Statcast API through baseball_scraper
  • Save to HTML via Plotly libraries

Data path diagram (output example below):

Diagram

Example plot of Yu Darvish's 2020 season. Pitches are selectable, with a double click function to clear or select all:

Yu Darvish 2020

About

[Python] Interactive plots showing MLB pitch locations from Statcast using Pandas and SQLite loaded via Plotly HTML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published