Postgresql Group By Concatenate Python Pandas Interview Question