Skip to content

Commit

Permalink
Fixed issue in parsing table for "big five" leagues
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzodb1 committed Mar 2, 2024
1 parent ee32968 commit c1d4e87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fbrefdata/fbref.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ def read_player_season_stats(self, stat_type: str = "standard") -> pd.DataFrame:
for elem in tree.xpath("//td[@data-stat='comp_level']//span"):
elem.getparent().remove(elem)
if big_five:
df_table = _parse_table(tree, "player")
(html_table,) = tree.xpath(f"//table[contains(@id, 'stats_{stat_type}')]")
df_table = _parse_table(html_table, "player")
df_table[("Unnamed: league", "league")] = (
df_table.xs("Comp", axis=1, level=1).squeeze().map(BIG_FIVE_DICT)
)
Expand Down

0 comments on commit c1d4e87

Please sign in to comment.