jtpavlock / nbapy

Python API for stats.nba.com
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Need Help Looping thru BoxScores #2

Closed luzer closed 4 years ago

luzer commented 4 years ago

i am trying just to get 2nd dataframe in the return, and loop thru all games

from nbapy import game
game_id = '0021900017'
stats = game.BoxScore(game_id).players_stats()
jtpavlock commented 4 years ago

All responses are returned as pandas dataframes. That's my fault for not documenting that, sorry!

I added a quick usage example to the wiki that should help.

Edit: rereading your question, I'm not entirely sure what you're trying to do. You are specifying a single game via "game_id" but are trying to loop through multiple games?

luzer commented 4 years ago

this worked, thanks! yes- i am trying to loop thru all games in the entire DB and append a DF. but i want to include the player's names

jtpavlock commented 4 years ago

It may not be exactly what you're looking for, but I just added a scoreboard endpoint that will allow you to see all game_ids for a given day which you can then loop through using the game endpoint