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 nba_api.stats.endpoints
from nba_api.stats.static import players
from nba_api.stats.static import teams
from nba_api.stats.endpoints import shotchartdetail
import pandas as pd
from pandas import DataFrame
import matplotlib as mpl
import matplotlib.pyplot as plt
BBplayers = players.get_players()
BBteams = teams.get_teams()
print(type(players))
print(BBplayers[0])
print(len(BBplayers))
## LEN PLAYERS = 4501 PLAYER TYPE IS DICTIONARIES INSIDE LIST
Durant = [player for player in BBplayers if player['full_name'] == 'Kevin Durant'][0]
Durant_id = Durant['id']
print(Durant_id)
## Durant ID = 201142
Thunder = [name for name in BBteams if name['full_name']=='Oklahoma City Thunder'][0]
Thunder_id = Thunder['id']
print(Thunder_id)
print(type(Thunder_id))
## Thunder ID = 1610612760
DurantShotsChart = shotchartdetail.ShotChartDetail(player_id='201142',team_id=1610612760)
print(DurantShotsChart)
NewDF=DurantShotsChart.get_data_frames()
print(type(NewDF))
print(NewDF[1])
print(len(NewDF))