1df["col_added"] = df.apply(lambda x: add_a_b(x["col_1"], x["col_2"]), axis = 1)
1def some_func(row, var1):
2 return '{0}-{1}-{2}'.format(row['A'], row['B'], var1)
3
4df['C'] = df.apply(some_func(row, var1='DOG'), axis=1)
5
6df
7
8
9 A B C
100 foo x foo-x-DOG
111 bar y bar-y-DOG
12