import pandas as pd
import numpy as np
df_a = pd.DataFrame([{'a': 1, 'b': 4}, {'a': 2, 'b': 5}, {'a': 3, 'b': 6},
    {'a': 4, 'b': 8}, {'a': 1, 'b': 7}])
df_b = pd.DataFrame([{'c': 2, 'd': 7}, {'c': 3, 'd': 8}, {'c': 2, 'd': 10}])
print('df_a')
print(df_a)
print('df_b')
print(df_b)
how to perform an inner or outer join of DataFrames with Pandas on non-simplistic criterion