a = numpy.arange(n1)
b = numpy.arange(n2)

def F(x, y):
    return x + y
fv = numpy.vectorize(F)
r = fv(a[:, (numpy.newaxis)], b)
Numpy quirk: Apply function to all pairs of two 1D arrays, to get one 2D array