nba_api icon indicating copy to clipboard operation
nba_api copied to clipboard

[Bug]: WNBA Commissioner's Cup PlayerGameLogs data non-existent for 2023 season.

Open Swingbiter opened this issue 1 year ago • 0 comments

NBA API Version

1.2.1

Issue

Issue:

Commissioner's Cup data is non-existent when getting WNBA PlayerGameLogs data for 2023 season

Notes:

Trying to get playergamelogs for the Las Vegas Aces vs. New York Liberty.

The game from 8/15/2023 is not showing up. This is an out of place game but is still within season.

ESPN has it listed here as a Regular Season game.

For season_type_nullable, I tried Regular Season, Pre Season and even Playoffs and All Star. None of them grabs the data for that specific date but games before and after that appear.

Steps:

  1. Get PlayerGameLogs - Make surve league_id_nullable is set to 10 and season_nullable to 2023
  2. Convert PlayerGameLogs to a DataFrame
  3. Filter the DataFrame to show only LVA games and drop empty rows.
  4. Print the DataFrame or export it to a file format like .csv
  5. Observe the data.

Result:

I expected Commissioner's Cup game data to appear in the PlayerGameLogs dataset.

Code

from nba_api.stats.endpoints import playergamelogs
import pandas as pd
from datetime import date


def main():
    gl = playergamelogs.PlayerGameLogs(
        season_nullable="2023",
        league_id_nullable="10",
        season_type_nullable="Regular Season",
    )

    gl_df: pd.DataFrame = gl.get_data_frames()[0]

    filter = gl_df["TEAM_ABBREVIATION"] == "LVA"
    gl_df = gl_df.where(filter).dropna(how="all")

    print(gl_df)
    gl_df.to_csv(f"{date.today()}-output.csv", index=False)
    pass


if __name__ == "__main__":
    main()

Swingbiter avatar Aug 21 '23 17:08 Swingbiter