dfnew = pd.DataFrame([1, 2, 3, 4, 5, 8], columns=['SingleNumber'])

def func(row):
    match = df_values[df_values == row['SingleNumber']]
if len(match) == 1:
    idx = match.index.get_level_values(0)[0]
col = match.index.get_level_values(1)[0]
return pd.Series({'AorB': df.loc[idx, 'A' if col == 'B' else 'B'], 'x': df.
    loc[idx, 'x']})
dfnew.join(dfnew.apply(func, axis=1)).dropna()
Find position of value, that occurs only once in dataframe