Postgresql Array Agg Group By Pandas Average