How to calculate the average values of a year from quarterly data? : <p>I have this dataframe and I want to calculate the average number of each year</p>

<pre><code>index   cath_date
1   2017Q4  111
2   2017Q3  107
3   2018Q2  105
4   2017Q2  105
5   2017Q1  101
7   2018Q3  98
8   2016Q3  97
9   2018Q1  94
10  2018Q4  91
11  2016Q1  91
12  2015Q4  85
13  2016Q4  83
14  2016Q2  81
15  2015Q3  80
16  2015Q2  67
18  2015Q1  28
</code></pre>

<p>Finally to have a dataframe like this</p>

<pre><code>index   cath_date
1   2015    28
2   2016    87
3   2017    87
4   2018    97
</code></pre>
