Accessing another row's data
Hi! I'm making a machine learning model to predict sports results (concretely, NFL results).
I have a table containing all the stats for the match for one team (i.e. Team#1 will have a different row than Team#2 for the same match, each match has 2 rows in this version of the table). I grouped this stats from another table that I have with each play from each match, using a "play team" attribute as the grouping attribute.
The problem that I have is for the defense plays that involves scoring as a counter attack when the defensive team intercepts the ball. Those plays are part of the offense team plays as they started them, so I cannot access this data from the other row. I know there's the "lag series" operator, but I cannot use it because I have to do it both ways (I can only use it from higher to lower rows, but no backwards as it doesn't accept negative numbers).
Do you know any other way to access the data from other rows? Do you recommend me other aproach instead of the one I'm using?
Thanks,
Carlos.