Hi Everyone,
I believe there are multiple ways of achieving the same results. So my question is, is it necessary to follow the approach given in the answers?
for example. the code in the solution for isolating the separation type ‘Resgination’ is
# Update all separation types containing the word “resignation” to 'Resignation’
dete_survey_updated[‘separationtype’] = dete_survey_updated[‘separationtype’].str.split(’-’).str[0]
# Check the values in the separationtype column were updated correctly
dete_survey_updated[‘separationtype’].value_counts()
Select only the resignation separation types from each dataframe
dete_resignations = dete_survey_updated[dete_survey_updated[‘separationtype’] == ‘Resignation’].copy()
tafe_resignations = tafe_survey_updated[tafe_survey_updated[‘separationtype’] == ‘Resignation’].copy()
while I have achieved the same thing from the following code
tafe_resignations =tafe_survey_updated[tafe_survey_updated [‘separationtype’]==‘Resignation’]
dete_resignations =dete_survey_updated[ dete_survey_updated[‘separationtype’].str.contains(‘Resignation’)]