Open JonStep123 opened 4 years ago
Can you post the exact code you were using and I can investigate?
What version of nba_api
are you using?
raw_data = leaguedashteamstats.LeagueDashTeamStats(team_id_nullable=1610612737)
print(raw_data.get_response())
print(raw_data.get_data_frames()[0])
This just worked for me.
most of the functions work, for example, the one you just said, however getting the shot locations has not worked for me. I am using the most current version.
Can you post an example of how you're using it? I'll need to do some research on this one because they change the usage of that endpoint frequently.
I did so in the previous comment but I will post it again. This is exactly how I am calling it. In your response to that comment, you posted that LeagueDashTeamStats was working for you, which is working for me as well, however, LeagueDashTeamShotLocations is what isn't working for me.
Oh wow, I totally tested the wrong endpoint originally. Sorry about that. I'll look into this later today.
@JonStep123 I am so sorry. I started looking into this and never posted it and then I got busy with work and the holidays.
Is this issue still persisting for you? This happens to be working for me.
from nba_api.stats.endpoints import *
raw_data = leaguedashteamshotlocations.LeagueDashTeamShotLocations(team_id_nullable=1610612737)
print(raw_data.get_response())
print(raw_data.get_json())
Feel free to reopen or create a new ticket if you still have questions.
@swar It seems the issue is not in the other endpoint returns but only the get_dataframe()
one. I can get a response grabbing json or dict, but they return a huge string that I would then need to parse myself. This is persistent for LeagueDashTeamShotLocations and LeagueDashPlayerShotLocations.
@SpecCRA I see what you mean. This one looks like it might need special handling for it to become a dataframe. I for some reason was misinterpreting the original message.
I will open this back up and mark it as a bug.
Hey @swar,
This API has been very useful for gathering data easily, however, I ran into an error when trying to pull using leaguedashteamlocations. the only parameter im passing is team_id_nullable and it works fine with get_dict(). I'm sure I'm just doing something wrong but any assistance would be appreciated!