[GH-ISSUE #46] [FBref] Seasons parameter does not work with read_player_season_stats method #5

Closed
opened 2026-03-02 15:54:57 +03:00 by kerem · 3 comments
Owner

Originally created by @Suwadith on GitHub (May 27, 2022).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/46

FBRef read_player_season_stats method does not seems to be considering the seasons parameter. No matter what the season is mentioned inside the brackets it just retrevied the recent season player stats. 2021-2022.

Code used is mentioned below

import soccerdata as sd

fbref = sd.FBref(no_cache=False, no_store=False, leagues="ENG-Premier League", seasons='11-12')
pl_player_season_stats = fbref.read_player_season_stats(stat_type='standard')
pl_player_season_stats .head()

Seasons parameter works perfectly with the read_team_season_stats method though.

Originally created by @Suwadith on GitHub (May 27, 2022). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/46 FBRef read_player_season_stats method does not seems to be considering the seasons parameter. No matter what the season is mentioned inside the brackets it just retrevied the recent season player stats. 2021-2022. Code used is mentioned below ``` import soccerdata as sd fbref = sd.FBref(no_cache=False, no_store=False, leagues="ENG-Premier League", seasons='11-12') pl_player_season_stats = fbref.read_player_season_stats(stat_type='standard') pl_player_season_stats .head() ``` Seasons parameter works perfectly with the read_team_season_stats method though.
kerem 2026-03-02 15:54:57 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Suwadith commented on GitHub (May 31, 2022):

Thanks for the update.
I still don't think this issue has been fixed.

I tried using the new 1.0.1 version, but the issue still prevails.
Below in the screenshot you can see that some of these players should not exists in the 15-16 squad.
It retrieves the data from the 2021-2022 season which is the most recent season ignoring the seasons parameter.

import soccerdata as sd

fbref = sd.FBref(no_cache=False, no_store=False, leagues="ENG-Premier League", seasons=2015)

player_season_stats = fbref.read_player_season_stats(stat_type="standard")
player_season_stats.head()

image_2022-05-31_014912361

<!-- gh-comment-id:1141565697 --> @Suwadith commented on GitHub (May 31, 2022): Thanks for the update. I still don't think this issue has been fixed. I tried using the new 1.0.1 version, but the issue still prevails. Below in the screenshot you can see that some of these players should not exists in the 15-16 squad. It retrieves the data from the 2021-2022 season which is the most recent season ignoring the seasons parameter. ``` import soccerdata as sd fbref = sd.FBref(no_cache=False, no_store=False, leagues="ENG-Premier League", seasons=2015) player_season_stats = fbref.read_player_season_stats(stat_type="standard") player_season_stats.head() ``` ![image_2022-05-31_014912361](https://user-images.githubusercontent.com/20539850/171072252-8dc048a9-d1e2-48af-a8f5-1429e6a409f4.png)
Author
Owner

@probberechts commented on GitHub (May 31, 2022):

Did you empty the cache? Try to set no_cache=True or remove the ~/soccerdata/data/FBref directory.

Also make sure you are really running the updated version by running print(sd.__version__).

<!-- gh-comment-id:1141723644 --> @probberechts commented on GitHub (May 31, 2022): Did you empty the cache? Try to set `no_cache=True` or remove the `~/soccerdata/data/FBref` directory. Also make sure you are really running the updated version by running `print(sd.__version__)`.
Author
Owner

@Suwadith commented on GitHub (May 31, 2022):

Did you empty the cache? Try to set no_cache=True or remove the ~/soccerdata/data/FBref directory.

Also make sure you are really running the updated version by running print(sd.__version__).

My bad. Thank you so much for pointing it out.
It works perfectly :)

<!-- gh-comment-id:1142363419 --> @Suwadith commented on GitHub (May 31, 2022): > Did you empty the cache? Try to set `no_cache=True` or remove the `~/soccerdata/data/FBref` directory. > > Also make sure you are really running the updated version by running `print(sd.__version__)`. My bad. Thank you so much for pointing it out. It works perfectly :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#5
No description provided.