I would need to select rows satisfying the following conditions:
- if (X is True and Z is false) | ( X is false and Z is true) then assign to a new column True as value.
I tried with this:
df[(df[X']==True & df['Z']==False) | (df['X']==False & df['Z']==True)]
but I got the following error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I have tried using any() as follows