So I have a dataframe in which I have all the substitutions made in the NBA for the 2014-2015 season . It looks like this. Now, for each team, I need to count the number of