I want to create a column with the maximum value between 2 values calculated from other columns of the data frame.
import pandas as pd
df = pd.DataFrame({"A": [1,2,3], "B": [-2, 8, 1]})
df['Max Col'] = max(df['A']*3, df['B']+df['A'])
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
The desired outcome is a new df column ['Max Col'] with the maximum value of the above calculations.
I know there is the long solution of creating two new columns with the calculations and then apply .max(axis=1). I am looking for a straight solution.
Thanks.