Postgres Row Number Partition By In Pandas