Numpy Array Indexing With Sql Function Parameters