[GH-ISSUE #354] [FBref] German League 2122: Length of values (53) does not match length of index (54) #68

Open
opened 2026-03-02 15:55:29 +03:00 by kerem · 2 comments
Owner

Originally created by @LuisEnriqueKaiser on GitHub (Sep 6, 2023).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/354

Hello everyone,

I want to scrape match data with the fbref.read_team_match_stats() function and it does work good for all leagues except for the german league. More specifically, it does not work for the 21-22 season.

My python version is 3.11 and I am using the latest soccerdata distribution.
I will attach a screenshot of the error message and of my code.

Screenshot 2023-09-06 at 10 06 59 Screenshot 2023-09-06 at 10 08 11

Kind regards

Originally created by @LuisEnriqueKaiser on GitHub (Sep 6, 2023). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/354 Hello everyone, I want to scrape match data with the fbref.read_team_match_stats() function and it does work good for all leagues except for the german league. More specifically, it does not work for the 21-22 season. My python version is 3.11 and I am using the latest soccerdata distribution. I will attach a screenshot of the error message and of my code. <img width="795" alt="Screenshot 2023-09-06 at 10 06 59" src="https://github.com/probberechts/soccerdata/assets/44476014/7cb40337-6c59-4940-ba9e-fb1057f2d84c"> <img width="795" alt="Screenshot 2023-09-06 at 10 08 11" src="https://github.com/probberechts/soccerdata/assets/44476014/4b122d5c-7077-456f-b2ce-2f99b771ff71"> Kind regards
Author
Owner

@probberechts commented on GitHub (Sep 6, 2023):

It looks like an inconsistency in the FBref website. The "match_report" stat is missing for some game of some team in the season. You can try to make the following snippet a bit more robust:

github.com/probberechts/soccerdata@f49cdf14fd/soccerdata/fbref.py (L644-L649)

<!-- gh-comment-id:1708238538 --> @probberechts commented on GitHub (Sep 6, 2023): It looks like an inconsistency in the FBref website. The "match_report" stat is missing for some game of some team in the season. You can try to make the following snippet a bit more robust: https://github.com/probberechts/soccerdata/blob/f49cdf14fd184f3535903a1cdc0336e3098b29f0/soccerdata/fbref.py#L644-L649
Author
Owner

@TimelessUsername commented on GitHub (Oct 10, 2023):

Similar issue with WhoScored, I'm currently trying to find out why 21-22 season fails to match the league...

Edit:

As the error is; KeyError: "[('ARG-Liga Profesional', '2122')] not in index", while input years are of the form [15, 16, ... , 20, 21, 22, 23], the string conversion logic seems to fail and thus fail to match the year. The 2122 form needs to be converted to 2022, I recon.

Edit2:

Various issues with different input formats too, the logic needs a bit of work I think.

Edit3: Appears whoscore doesnt have some of the years during the virus...

<!-- gh-comment-id:1755206670 --> @TimelessUsername commented on GitHub (Oct 10, 2023): Similar issue with WhoScored, I'm currently trying to find out why 21-22 season fails to match the league... Edit: As the error is; KeyError: "[('ARG-Liga Profesional', '2122')] not in index", while input years are of the form [15, 16, ... , 20, 21, 22, 23], the string conversion logic seems to fail and thus fail to match the year. The 2122 form needs to be converted to 2022, I recon. Edit2: Various issues with different input formats too, the logic needs a bit of work I think. Edit3: Appears whoscore doesnt have some of the years during the virus...
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#68
No description provided.