11 August 2015
No there hasn’t been a sudden change in ticket prices that is going to allow you to sit courtside (especially hard when you live in London as the NBA would have to partner with BA to drop flight prices as well). So what have they done to make me write this blog post?Quite simply this:Great – another table of data – big woop. Lend me one more minute and then you can go and click on espn.com or grantland.com to go and see how the pro’s do this.The NBA have opened a whole new set of statistics that allow you to monitor game, assess player performance and spot trends that were previously just gut instinct. This all stems from the ingenious SportsVu ([insert link to SportsVu]) that has revolutionalised not only how the game has been measured but is revolutionising how the game is coached.As this data is in a webpage, it’s actually held in an underlying page that we can access. Using the ‘Inspect Element’ option on your browsers right-click menu, then you can find the source of the pages information. For example, our page we need to get to is:Using just Alteryx and Tableau, I have created a package that allows me to pull back statistics from the Playoffs, re-run them when I want to and start analysing in minutes. Now I can access the distance every defender was from their shooter and whether they successfully altered the shot or not. Want to know how? Then follow these steps:The Alteryx bit…What I need to achieve:
- Find out how to scroll through URLs that hold the information for each player
- Find a way to identify the ‘Player IDs’ that will prevent me from having to scroll through a load of URLs until I hit one that pulls back data for each player
- Scrape that information in to a flat file
- Transform that information in to a format that it can be read in Tableau (phew that sounds like a fair bit of work – not in Alteryx it isn’t)
- Freaking awesome visualisations
- Using new metrics that I haven’t had access to in box scores previously (like distance from defender etc)
- Which team are creating the most space between their defenders and themselves when shooting?
- Who in the league is dribbling more than others before their shot and does that increase their shooting percentage?
- Are defenders being closer to the shoot when nearer the basket a greater inhibitor to the shooter than at the 3-point line?