DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+9 =
Submit