print (pd.merge(a,b, indicator=True, how='outer') .query('_merge=="left_only"') .drop('_merge', axis=1)) 0 1 0 1 10 2 3 30