probberechts / soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, FiveThirtyEight, Football-Data.co.uk, FotMob, Sofascore, SoFIFA, Understat and WhoScored.

Home Page:https://soccerdata.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FBref] read_schedule with default params returns key error

Kalaweksh opened this issue · comments

This block of code in FBref.read_leagues(split_up_big5 = True) tries to index "Big 5 European Leagues Combined" with the individual league names, producing a key error downstream.image

(By default the top array contains the leagues attempting to be indexed)
image

I am not sure whether I get this. Can you give a minimal code example that produces the error?

It occurs when calling FBref.read_schedule() with a cached FBref object. Seems to be avoided by using no cache and specifying leagues and seasons as you suggested in #658 :

import soccerdata as sd
fbref = sd.FBref("ENG-Premier League", 2425, no_cache=True)
fbref.read_seasons()