Error in Boolean Indexing

Screen Link:

My Code:

dete_resignations=dete_survey_updated[dete_survey_updated["separationtype"]=="Resignation-Other reasons" or dete_survey_updated["separationtype"]=="Resignation-Other employer" or dete_survey_updated["separationtype"]=="Resignation-Move overseas/interstate"]

What I expected to happen:
I thought through boolean indexing like this, I could select rows from dete_survey_updated where column separationtype is either Resignation-Other reasons or Resignation-Other employer or Resignation-Move overseas/interstate

What actually happened:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
1 Like

Hi @bhumikagupta100366,

You should use | instead of or. Also, you should put each of your 3 conditions in rounded brackets.