if there is a value in column then 1 else 0 in python code example Example: set value based on column df.loc[df['c1'] == 'Value', 'c2'] = 10