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
##Remove all zip files excluding 01.02.2016.HOU.at.SAS , 01.03.2016.CHI.at.TOR , 12.25.2015.CLE.at.GSW, before proceeding with Data Setup
1.To unzip the 7z files, ensure 7z is installed on your computer first.
Then, run this command:
cd data && ./setup.sh- Install the package.
(From the package root direction)
python setup.py build
pip install -e .- Convert the JSON files.
python movement/json_to_csv.py- Convert the full-court to half-court. An explanation of moving the SportVU movement can be found here.
python movement/convert_movement.py- 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 movement/fix_shot_times.pyIn 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.
