ia, ib = np.where(np.less.outer(df_a.a, df_b.c))
print(pd.concat((df_a.take(ia).reset_index(drop=True), df_b.take(ib).
    reset_index(drop=True)), axis=1))
how to perform an inner or outer join of DataFrames with Pandas on non-simplistic criterion