I have a dataframe and want to create a new column in the dataframe based on certain condition.
The condition goes like this: if (column_1 >=5 and column_2 >= 10) or (column_3 >=6) then 1 else 0.
What is the most efficient way to create this equation in pandas.
copying the note from the comments to the body of the question.
I have tries this:
df['Flag']= np.where((((df['Column_1']>=5) & (df['Column_2']>= 10)) | df['Column_3']>=6),1,0)
Thanks!