Python Numpy Aggregate Functions Postgresql Vs T Sql