socceraction icon indicating copy to clipboard operation
socceraction copied to clipboard

Handle games without actions

Open probberechts opened this issue 1 year ago • 0 comments

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: ...

probberechts avatar Apr 12 '23 14:04 probberechts