Postgres Find Value In Column Pandas Group By Mean