for idx, row in df.iterrows(): if df.loc[idx,'Qty'] == 1 and df.loc[idx,'Price'] == 10: df.loc[idx,'Buy'] = 1