What I expected to happen:
the dete_survey_updated dataframe contains three Resignation separation types. We want to select all of them.
What actually happened:
error```
<!--Enter other details below: -->
This is the tafe solution tafe_resignations = tafe_survey_updated[tafe_survey_updated['separationtype'] == 'Resignation'].copy()
however the dete one includes more elements
I will try to make it easy for both of us to work on this. There are two ways you can extract all types of âResignationâ:
in your code instead of assigning multiple copies of dataframes to one single dataframe (yup you might be doing that here! break your code and see), you can combine the conditions with | (symbol for or) as in:
df = df[(df.col == type1) | (df.col == type2) | and so on]
In the prior missions, you might have come across .str.contain(pattern) try to review this code part and then device your solution.
thank you for asking this question and that too pointedly at me. I am hardly getting any chance to respond post the Learning assistant Prog.
Have you tried printing the pattern variable after you have declared it? Direct answer - yup the usage of or here is wrong.
Itâs like code is giving choice to pattern variable to pick one among the 3 and since itâs OR it takes the first value. Change OR to AND see the difference!