Postgresql Create Replace Function In Python Pandas Practice