Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

apply on dataframe access multiple columns

df['col_3'] = df.apply(lambda x: x.col_1 + x.col_2, axis=1)
Source by codeforests.medium.com #
 
PREVIOUS NEXT
Tagged: #apply #dataframe #access #multiple #columns
ADD COMMENT
Topic
Name
1+7 =