Calculate averages for each country, from a data frame : <p>I'm working on a dataframe called 'df'. Two of the columns in 'df' are 'country' and 'dissent'. I need to calculate the average dissent per country. What is the most effective way to iterate through the data frame and calculate the averages by country? </p>

<p>I tried for loops but it does not work and also I don't think it is the most effective way.</p>
