лямбда с двумя колоннами панд
tp['col'] = tp.apply(lambda row: row['source'] if row['target'] in ['b', 'n'] else 'x',
axis=1)
sani
tp['col'] = tp.apply(lambda row: row['source'] if row['target'] in ['b', 'n'] else 'x',
axis=1)
df['new_col'] = df.apply(lambda x: some_func(x['col1'], x['col2']))