Skip to main content

Graphing NBA player and team stats using matplotlib

Project description

NBAGrapher

NBA Grapher is a python script that can make plots and graphs of NBA comparing various statistical measures of NBA players and teams

NBA Grapher uses sportsreference for scraping data from basketball-reference and creates plots using matplotlib

Currently, four types of graphs are supported.

  • Player stat by season
  • Player stat by game
  • Team stat by season
  • Team stat by game

Details on each of these functions can be found in the full documentation

A full list of avaiable statistics for each function can be found here.


Installation

NBAGrapher can be installed from PyPi using PIP

$ pip install nbagrapher

Examples

Season based
  • VORP of two players throughout their career
nbagrapher.plot_player_season(['iversal01','bryanko01'],"value_over_replacement_player")

vorp

  • PER of the last five MVPs over the last five years
nbagrapher.plot_player_season(['antetgi01','hardeja01','westbru01','curryst01','duranke01'],"player_efficiency_rating",start_year=2014,end_year=2019)

per

  • Cumulative points of the five top points scorers over the last decade
nbagrapher.plot_player_season(['jamesle01','duranke01','hardeja01','westbru01','curryst01'],"points",start_year=2010,cum=True)

points

Game based
  • Win Shares for January 2019
nbagrapher.plot_player_game(['embiijo01','antetgi01'],2019,"true_shooting_percentage",start_date=datetime.date(2019,1,1),end_date=datetime.date(2019,2,1))

ts

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NBAGrapher-1.0.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

NBAGrapher-1.0.0-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page