Python Numpy Aggregate Functions Postgresql Create