I have a large csv file, example of the data below. I will use an example of eight teams to illustrate.
home_team away_team home_score away_score year
belgium france 2 2 1990
brazil uruguay 3 1 1990
italy belgium 1 2 1990
sweden mexico 3 1 1990france chile 3 1 1991
brazil england 2 1 1991
italy belgium 1 2 1991
chile switzerland 2 2 1991
My data runs for many years. I would like to have total number of scores of each team every year, see example below,
team total_scores year
belgium 4 1990
france 2 1990
brazil 3 1990
uruguay 1 1990
italy 1 1990
sweden 3 1990
mexico 1 1990france 3 1991
chile 5 1991
brazil 2 1991
england 1 1991
italy 1 1991
belgium 2 1991
switzerland 2 1991
Thoughts?