Git Product home page Git Product logo

nba-movement-data's Introduction

nba-movement-data

Ever since the nba stopped public access of their movement data, I though it would be good to have a copy of @neilmj data repo incase he deletes his data repo.

Credit: @neilmj

Data Setup

1.To unzip the 7z file run this command

cd data
sudo ./setup.sh

Additional Data Conversions

  1. Additional scripts are provided. To complete these steps, add your project directory to the constant.py file in the movement package.
import os
# change this data_dir for personal path
if os.environ['HOME'] == '/home/neil':
    data_dir = '/home/neil/projects/nba-movement-data'
else:
    raise Exception("Unspecified data_dir, unknown environment")
  1. Install the user package. You may need to run this in sudo.
python setup.py build
python setup.py install
  1. Convert the JSON files.
python movement/json_to_csv.py
  1. Convert the full-court to half-court. An explanation of moving the SportVU movement can be found here.
python movement/convert_movement.py
  1. The fixed shot times, along with the shot locations in half court space are in data/shots/fixed_shots.csv. They are formed from executing the script.
python fix_shot_times.py

In the fixing logic, the shot time is defined as the highest acceleration point before the ball reaches it's peak, within a defined window. The logic can be seen below. plot

nba-movement-data's People

Contributors

sealneaward avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.