Subquery With Group By Pandas Aggregate