[GH-ISSUE #292] [FBref] Summary stats shows error when concatenating different matches #56

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

Originally created by @danielbaltruschat on GitHub (Jul 12, 2023).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/292

The fbref class is set to read from the English Premier league for the 17-18 season.

Error:

get all schedule copy.py 41 <module>
match_summary_stats = fbref.read_player_match_stats(stat_type="summary")

fbref.py 804 read_player_match_stats
df = _concat(stats)

fbref.py 1103 _concat
df.columns = pd.MultiIndex.from_tuples(columns.to_records(index=False).tolist())

generic.py 5915 __setattr__
return object.__setattr__(self, name, value)

properties.pyx 69 pandas._libs.properties.AxisProperty.__set__


generic.py 823 _set_axis
self._mgr.set_axis(axis, labels)

managers.py 230 set_axis
self._validate_set_axis(axis, new_labels)

base.py 70 _validate_set_axis
raise ValueError(

ValueError:
Length mismatch: Expected axis has 28 elements, new values have 36 elements
Originally created by @danielbaltruschat on GitHub (Jul 12, 2023). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/292 The fbref class is set to read from the English Premier league for the 17-18 season. Error: ``` get all schedule copy.py 41 <module> match_summary_stats = fbref.read_player_match_stats(stat_type="summary") fbref.py 804 read_player_match_stats df = _concat(stats) fbref.py 1103 _concat df.columns = pd.MultiIndex.from_tuples(columns.to_records(index=False).tolist()) generic.py 5915 __setattr__ return object.__setattr__(self, name, value) properties.pyx 69 pandas._libs.properties.AxisProperty.__set__ generic.py 823 _set_axis self._mgr.set_axis(axis, labels) managers.py 230 set_axis self._validate_set_axis(axis, new_labels) base.py 70 _validate_set_axis raise ValueError( ValueError: Length mismatch: Expected axis has 28 elements, new values have 36 elements ```
kerem 2026-03-02 15:55:23 +03:00
  • closed this issue
  • added the
    FBref
    label
Author
Owner

@lorenzodb1 commented on GitHub (Jul 13, 2023):

#284 should fix this issue

<!-- gh-comment-id:1635043505 --> @lorenzodb1 commented on GitHub (Jul 13, 2023): #284 should fix this issue
Author
Owner

@probberechts commented on GitHub (Jul 14, 2023):

This seems to work fine. Make sure you have the latest version installed and disable caching (likely, you are mixing old cached data with newly retrieved data). I ran the code below.

import soccerdata as sd
fbref = sd.FBref("ENG-Premier League", "1718", no_cache=True)
match_summary_stats = fbref.read_player_match_stats(stat_type="summary", no_cache=True)
<!-- gh-comment-id:1635910931 --> @probberechts commented on GitHub (Jul 14, 2023): This seems to work fine. Make sure you have the latest version installed and disable caching (likely, you are mixing old cached data with newly retrieved data). I ran the code below. ```python import soccerdata as sd fbref = sd.FBref("ENG-Premier League", "1718", no_cache=True) match_summary_stats = fbref.read_player_match_stats(stat_type="summary", no_cache=True) ```
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#56
No description provided.