socceraction
socceraction copied to clipboard
Handle games without actions
Some games (e.g, postponed games) might have an empty event feed. This results in errors while computing features and labels.
import pandas as pd
import socceraction.atomic.vaep.features as fs
import socceraction.atomic.spadl as atomicspadl
xfns = [ fs.goalscore ]
actions = pd.DataFrame()
gamestates = fs.gamestates(atomicspadl.add_names(actions), 2)
X = pd.concat([fn(gamestates) for fn in xfns], axis=1)
>> IndexError: ...