Postgres Get Count Of Unique Values In Python