-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Data Not Reconciling #470
Comments
@bbq-x - The NBA manages all data, we are just passing that data through the library. You could attempt to contact the NBA, but I'm uncertain of that process. |
The data is correct on the NBA site. When I break it down by lineup and box
score, the aggregations match on the site. But when using the API, the
final game between Dallas and Boston, those aggregations do not match. But
okay. Thanks for replying.
…On Wed, Oct 23, 2024 at 10:38 AM rsforbes ***@***.***> wrote:
@bbq-x <https://github.com/bbq-x> - The NBA manages all data, we are just
passing that data through the library. You could attempt to contact the
NBA, but I'm uncertain of that process.
—
Reply to this email directly, view it on GitHub
<#470 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3VMM4M2HT2WLBGUZQORK7DZ46YF7AVCNFSM6AAAAABQICBSE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZSGQ2DMNRZHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Attached is a document that better explains my issue. I use playergamelogs and iterate by period. I compare this data to the period data obtained using teamdashlineups. I have acquired data from these two endpoints for the entire three previous seasons. The document lays out the discrepancies. The parsing of the info is as follows: For turnovers, they're a mess. [total from playergamelogs] : [total from teamdashlineups] |
NBA API Version
1.6.0
Issue
The last game of the finals (game_id: 0042300404), the aggregated data for the teams is not equal between 'playergamelogs' and 'teamdashlineups' endpoints. I have been able to collect data from both endpoints by game id and period for literally every game the previous three seasons except for the game listed above.
Code
This is the code I use to validate the two sources. I use the API to store to a database and then I pull from my database
def get_stats(table,table_var,id):
sql = f"select {test_json} from {table}_{table_var} where game_id = '{id}'"
df = pd.read_sql_query(sql,con=engine)
df.columns = common_cols
sql = f"select game_id from events_{table_var}"
with con.cursor() as cur:
cur.execute(sql)
games = [item[0] for item in cur.fetchall()] # Returns table data in a one-element tuple
for id in games:
comp_list = []
for table in table_names[1:]:
comp_list.append(get_stats(table,table_var,id))
for col in common_cols:
player_val = comp_list[0][col].iloc[0]
lineup_val = comp_list[1][col].iloc[0]
if player_val != lineup_val:
if col != "TOV":
print(id,col,player_val,lineup_val)
The text was updated successfully, but these errors were encountered: