Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
lambda with two columns pandas
theman26
Programming language:
Python
2021-08-08 09:13:56
0
Q:
lambda with two columns pandas
ArbitraryRenaissance
Code:
Python
2021-06-12 17:26:58
tp['col'] = tp.apply(lambda row: row['source'] if row['target'] in ['b', 'n'] else 'x', axis=1)
1
Tags
columns
two
pandas
two columns
Related
python add multiple columns to pandas dataframe
pandas merge two columns from different dataframes
python pandas selecting multiple columns
pandas create a new column based on condition of two columns
pandas create new column conditional on other columns
pandas apply function to each row lambda
how to merge two pandas dataframes on a column
use apply with lambda pandas
pandas sum multiple columns groupby
python pandas apply function to one column
lambda in pandas
lambda x: %d % ', '.join(x) for integers
pandas lambda if else
pandas apply function to column
set dtype for multiple columns pandas
assign multiple columns pandas
New to Communities?
Join the community