Postgres Flatten Array Numpy Python Library