Here is my code: I have three conditions profit, loss and discount
if df['Condition'] == "Profit":
df["price"]= df["costprice"]- 1.5*df["sp"]
elif df['Condition'] == "Loss":
df["price"]= df["costprice"]- 1.5*df["sp"]
else:
df["price"]= df["targetprice"]-1.5*df["sp"]