Script for PBP w/ Lineups

Home for all your discussion of basketball statistical analysis.
Post Reply
italia13calcio
Posts: 100
Joined: Sun Dec 08, 2013 2:54 am

Script for PBP w/ Lineups

Post by italia13calcio »

I have seen a few threads talking about scraping play-by-play with lineups, for use in calculating APM derivatives. I created a script last year for doing so from stats.nba.com, and have uploaded it to GitHub.

https://github.com/hwchase17/Play-By-Pl ... th-Lineups

This gets all PBP w/ lineups for the 2016-17 season (changing season is trivial) and saves it to a .csv file.

It works successfully for the past two seasons, but I haven't tested it out on any others. I don't imagine there should be any errors, please let me know - best way is on Twitter @aabsblog as I don't check this forum that often.
https://hwchase17.github.io/sports/

Follow me @aabsstats - I follow back ;)
jgoldstein34
Posts: 249
Joined: Fri Sep 30, 2016 6:38 pm

Re: Script for PBP w/ Lineups

Post by jgoldstein34 »

This is much appreciated, thank you for sharing!
shadow
Posts: 252
Joined: Fri May 29, 2015 3:38 am

Re: Script for PBP w/ Lineups

Post by shadow »

Does anyone have a script to create aggregated matchup files (similar to what used to be available at basketball value) from the csv generated by this script? I suppose this would involve calculating the number of possessions and scoring margin for each matchup stint. Here is a link to the output for 2016-17:

https://www.dropbox.com/sh/3gj9jpcpeo75 ... ?dl=0&lst=

I can continue creating the pbp for previous years and post them to the dropbox folder linked above if anyone is interested.
DSMok1
Posts: 1119
Joined: Thu Apr 14, 2011 11:18 pm
Location: Maine
Contact:

Re: Script for PBP w/ Lineups

Post by DSMok1 »

Developer of Box Plus/Minus
APBRmetrics Forum Administrator
Twitter.com/DSMok1
shadow
Posts: 252
Joined: Fri May 29, 2015 3:38 am

Re: Script for PBP w/ Lineups

Post by shadow »

Cool, thanks.
Post Reply