How to apply a function to two columns in a Pandas DataFrame in Python Use pandas.DataFrame.apply() Use any two-input function