Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

apply lambda function to multiple columns pandas

df['new_col'] = df.apply(lambda x: some_func(x['col1'], x['col2'])) 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #apply #lambda #function #multiple #columns #pandas
ADD COMMENT
Topic
Name
1+1 =