def pir(A, B):
    return A.values[process(A, B)[:, (0)], 0]

def maxu(A, B):
    return B.apply(lambda x: A.loc[(A.latw < x.Lat) & (x.Lat < A.late) & (A
        .lngs < x.Lng) & (x.Lng < A.lngn), 'type'].head(1), axis=1
        ).values.diagonal()
Fast (vectorized) way to find points in one DF belonging to equally sized rectangles (given by two points) from the second DF