I have a dataframe,containing values of name and verified columns, i want to see if the conditions meet and it generates a new column with different valuess based on the condition, For eg:
Name | Verified |
---|---|
Mary | Yes |
Julie | No |
Mary | No |
Expected data:
Name | Verified | Identity |
---|---|---|
Mary | Yes | Bot |
Julie | No | Bot |
Mary | No | Human |
What i have done: I require a field where condition is if name is Mary and verified is No then print Human else Bot,
df['Identity']=df((df['name'] == 'Mary') & (df['Verified'] == 'No)),
I am not sure how to print human or bot based on the condition, can anyone please help?Thank you