Answers for "lambda with two columns pandas"

2

lambda with two columns pandas

tp['col'] = tp.apply(lambda row: row['source'] if row['target'] in ['b', 'n'] else 'x',
                     axis=1)
Posted by: Guest on August-11-2020

Code answers related to "lambda with two columns pandas"

Python Answers by Framework

Browse Popular Code Answers by Language