set a column with max of 2 in dataframe code example Example: max of two columns pandas df["C"] = df[["A", "B"]].max(axis=1)