使用matplotlib绘制nba球员和球队数据
NBAGrapher的Python项目详细描述
nbagrapher
nba grapher是一个python脚本,它可以绘制nba的图表,比较nba球员和球队的各种统计指标
nba grapher使用sportsreference从basketball-reference中删除数据,并使用matplotlib创建绘图
目前,支持四种类型的图。
- 按季节列出的球员统计
- 按游戏列出玩家状态
- 按季节分列的球队统计数据
- 按游戏分组统计
有关这些函数的详细信息,请参见完整的documentation
可以找到每个函数的可用统计信息的完整列表here。
安装
可以使用pip从pypi安装nbagrapher
$ pip install nbagrapher
示例
季节性
- 两名球员职业生涯中的VORP
nbagrapher.plot_player_season(['iversal01','bryanko01'],"value_over_replacement_player")
- 过去五年中过去五个MVP中的每一个
nbagrapher.plot_player_season(['antetgi01','hardeja01','westbru01','curryst01','duranke01'],"player_efficiency_rating",start_year=2014,end_year=2019)
- 过去十年五大得分王的累计得分
nbagrapher.plot_player_season(['jamesle01','duranke01','hardeja01','westbru01','curryst01'],"points",start_year=2010,cum=True)
基于游戏的
- 赢取2019年1月的股份
nbagrapher.plot_player_game(['embiijo01','antetgi01'],2019,"true_shooting_percentage",start_date=datetime.date(2019,1,1),end_date=datetime.date(2019,2,1))
许可证
麻省理工学院