よく忘れるので自分的なメモです。
import pandas as pd
def my_func(row):
d = row['A'] + row['B'] + row['C']
if row['A'] > 6:
d = 10
return d
df = pd.read_excel('Book1.xlsx')
print(df)
df['D'] = df.apply( my_func, axis=1)
print(df)
A B C 0 1 100.0 9 1 2 500.0 67 2 3 40.0 45 3 4 5.0 34 4 5 5.4 2 5 6 7.0 1 6 7 90.0 4 7 8 74.0 5 8 9 1000.0 6 9 10 40.0 7 A B C D 0 1 100.0 9 110.0 1 2 500.0 67 569.0 2 3 40.0 45 88.0 3 4 5.0 34 43.0 4 5 5.4 2 12.4 5 6 7.0 1 14.0 6 7 90.0 4 10.0 7 8 74.0 5 10.0 8 9 1000.0 6 10.0 9 10 40.0 7 10.0