Python module to plot NBA shot chart data and distributions for players and teams and some utilities.
This file will become your README and also the index of your documentation.
Install¶
pip install shot_chart
How to use¶
We first create a pandas dataframe from the source data.
shots_2019 = make_df(untar_data(URLs.SHOTS_2019))
Listing teams for the season¶
list_teams(shots_2019)
Listing players who took at least 1 shot for a particular team¶
list_team_players(shots_2019, 'Portland')
Plotting team shot distribution¶
houston = TeamShots(shots_2019,"Houston")
houston.plot_shots()
houston.plot_shots(date_range=((2020,1,3), (2020,1,11)))
Please check the extra options when using the plotting functions
portland_20191125 = TeamShots(shots_2019,"Portland")
portland_20191125.list_game_ids(2019,11,25)
portland_20191125.plot_shots("201911250CHI")
Plotting player shot distribution¶
player_shots = PlayerShots(shots_2019,"Anthony Davis")
player_shots.plot_shots()
dlo = PlayerShots(shots_2019,"D'Angelo Russell")
dlo.plot_shots()
dlo.plot_shots(distance_limit=(16,26),attempt="2-pointer")
dlo.plot_effective(most_or_least="most")
dlo.plot_effective(most_or_least="most",exclude=["0ft"])
dlo.plot_effective(most_or_least="most",min_shots="auto",exclude=['2ft'])
dlo.plot_effective(most_or_least="least")
dlo.plot_effective(most_or_least="least",min_shots="auto")