Questions tagged [nba-api]

nba-api is an python API client to access the APIs for NBA.com. Support for pandas and built with Jupyter Notebooks in mind, though both are optional. Questions on SO should be focussed on implementing the package and working with the data that's available.

A python API Client package to access the APIs for NBA.com.

Useful Links

34 questions
0
votes
1 answer

How are pace adjusted stats calculated?

Does anyone know how NBA.com calculates pace adjusted stats? When pulling data, there is a pace_adjust option -- I'm wondering how that differs from non pace adjusted. Conceptually I understand what it means, just wondering how they account for it.…
megalina
  • 31
  • 2
0
votes
0 answers

How to add a date value column in dataframe with repeating names and seasons in python?

NBA dataset per year stats for players with different number of seasons played: ex: Name , Season, Points, Reb Lebron James, 2003-04, 25ppg, 10red Lebron James, 2004-05, 26ppg, 10reb Lebron James, 2005-06, 27ppg, 9reb Michael…
Hman
  • 1
0
votes
1 answer

Can only pull 2020 team roster using commonteamroster endpoint

I'm currently attempting to grab the latest team rosters from the NBA using the commonteamroster endpoint, but it seems like whatever season_id I enter, it only returns the 2020 rosters. The roster I am looking at grabbing can be found…
0
votes
1 answer

Problem getting data with NBA API: JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I run the following code for getting data from the NBA API and Im getting the above mentioned error. Any help is appreciated. from nba_api.stats.endpoints import leaguedashteamstats import requests import json import pandas as pd response =…
0
votes
1 answer

Fetching data from nba.com/stats/transactions/

Is there a method in the nba-api package which allows querying the endpoint for data regarding transactions between teams (https://www.nba.com/stats/transactions/)?
wisk
  • 3
  • 1
0
votes
1 answer

How to view all the data from data frame? via NBA_API

Code: from nba_api.stats.endpoints import commonteamroster spurs = commonteamroster.CommonTeamRoster(team_id=1610612759).get_data_frames() print(spurs) Results: [ TeamID SEASON LeagueID ... EXP SCHOOL PLAYER_ID 0 …
0
votes
1 answer

NBA API: Looping a dictionary to get data frames

I am trying to get a full database of all active players career stats in the NBA. I'm relatively new to Python and am trying to figure out a way to iterate a loop function by looking up the playerID for each PlayerCareerStat data frame. Ultimately I…
olideepo
  • 13
  • 1
0
votes
1 answer

How to get nba shot chart data correctly?

I want to get data from nba site to create shot chart. I get it from this site https://datavizardry.com/2020/01/28/nba-shot-charts-part-1/?fbclid=IwAR3BheHQkSAmCJRr_z7ux1ygbspLjLdrvTRjWAVHOrr2BPvVh7jsIos_e9w and my code looks like this: from…
0
votes
1 answer

DateFrom DateTo Format

I'm currently trying to use the endpoint player game logs in order to retrieve the game stat of a specific player throw a particular period of time. so I want to use the attributes date_from_nullable and date_to_nullable and the problem is I always…
0
votes
2 answers

How do I convert NBA-API List to DataFrame

Having an issue converting NBA-API object to a DataFrame. What I get is a list of the dataframe. How do I pull the DataFrame out the list or skip the list and create the DataFrame. ## NBA API endpoints needed to obtain data import…
user14237286
  • 109
  • 10
0
votes
1 answer

Value Error Mismatch While Converting Using Pandas

here is the mismatch error I keep getting. I'm inputting "202710". Traceback (most recent call last): File "nbastatsrecieveit.py", line 29, in df.columns = headers File…
Lazed
  • 9
  • 2
0
votes
1 answer

Traceback Error when Using Pandas to Convert NBA API data

I was using pandas to convert the NBA API JSON format to csv, and am getting a traceback error. Now I will note I ran into another traceback error a few days ago, but this one is different. This error is troubling me in particularly because the same…
Lazed
  • 9
  • 2
0
votes
1 answer

Traceback when using Pandas to convert to Json Format

I recently have been trying to use the NBA API to pull shot chart data. I'll link the documentation for the specific function I'm using here. I keep getting a traceback as follows: Traceback (most recent call last): File "nbastatsrecieve2.py",…
Lazed
  • 9
  • 2
0
votes
0 answers

Remote API call working local but not working in production

I am creating my first web app and hosting it on Heroku's free version. It is an NBA statistics site and so as part of my application I make a call to a remote API to retrieve the stats for a certain player. When I run this on the local server via…
0
votes
0 answers

Problem creating .exe file using pyinstaller or auto-py-to-exe

I am trying to make an .exe file of my python script that provides an easy interface (using Tkinter) to generate Shot Charts from NBA players (using matplotlib) all over the years, this one just below: But when I tried to create the .exe using…