Lambda mit zwei Säulen Pandas
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']))