nba_api icon indicating copy to clipboard operation
nba_api copied to clipboard

Repeated TEAM_CODE on TeamInfoCommon

Open gutorsantos opened this issue 3 years ago • 1 comments

Hello, Handling the library I noticed a little bug on TeamInfoCommon

I'm running this following code:

    team_info = teaminfocommon.TeamInfoCommon(team_id=1610612737).get_dict()
    print(team['resultSets'][0]['rowSet'][0])

I checked and the headers are being returned as expected by Docs. However, looking at the rowSet I noticed that TEAM_CODE is being repeated. This is what is returning to me:

[1610612737,
'2021-22',
'Atlanta',
'Hawks',
'ATL',
'East',
'Southeast',
'hawks',
'hawks',       # repeated
40,
37,
0.519,
10,
2,
'1949',
'2021']

I even put a table to do a double check image

gutorsantos avatar Apr 01 '22 21:04 gutorsantos

There is an additional field after "Team Code" called "Team Slug" which is also set to "hawks". Maybe it gets used as an ID in other situations? Not sure where the headers came from in your screenshot, but mine included both.

'name': 'TeamInfoCommon', 'headers': ['TEAM_ID', 'SEASON_YEAR', 'TEAM_CITY', 'TEAM_NAME', 'TEAM_ABBREVIATION', 'TEAM_CONFERENCE', 'TEAM_DIVISION', 'TEAM_CODE', 'TEAM_SLUG', 'W', 'L', 'PCT', 'CONF_RANK', 'DIV_RANK', 'MIN_YEAR', 'MAX_YEAR'], 'rowSet': [[1610612737, '2024-25', 'Atlanta', 'Hawks', 'ATL', 'East', 'Southeast', 'hawks', 'hawks', 11, 11, 0.5, 6, 2, '1949', '2024']]

wild-bill avatar Dec 03 '24 16:12 wild-bill