I have a df (df1) that looks like:
df1 = pd.DataFrame([ [\'YYZ\', \'SFO\', 1], [\'YYZ\', \'YYD\', 1], [\'YYZ\', \'EWR\', 1], [\'Y
merge
indicator=True
query
'left_only'
df1.merge( df2, how='outer', indicator=True ).query('_merge == "left_only"').drop('_merge', 1) city1 city2 val 2 YYZ EWR 1 3 YYZ DFW 1 4 YYZ LAX 1 5 YYZ YYC 1