{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Clean and Analyze Employee Exit Surveys\n", "\n", "In this project, we'll clean and analyze exit surveys from employees of the [Department of Education, Training and Employment (DETE)](https://en.wikipedia.org/wiki/Department_of_Education_and_Training_(Queensland)}) and the Technical and Further Education (TAFE) body of the Queensland government in Australia. The TAFE exit survey can be found [here](https://data.gov.au/dataset/ds-qld-89970a3b-182b-41ea-aea2-6f9f17b5907e/details?q=exit%20survey) and the survey for the DETE can be found [here](https://data.gov.au/dataset/ds-qld-fe96ff30-d157-4a81-851d-215f2a0fe26d/details?q=exit%20survey).\n", "\n", "We'll pretend our stakeholders want us to combine the results for *both* surveys to answer the following question:\n", " \n", " - Are employees who only worked for the institutes for a short period of time resigning due to some kind of dissatisfaction? What about employees who have been there longer?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction\n", "\n", "First, we'll read in the datasets and do some initial exporation." ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDSeparationTypeCease DateDETE Start DateRole Start DatePositionClassificationRegionBusiness UnitEmployment StatusCareer move to public sectorCareer move to private sectorInterpersonal conflictsJob dissatisfactionDissatisfaction with the departmentPhysical work environmentLack of recognitionLack of job securityWork locationEmployment conditionsMaternity/familyRelocationStudy/TravelIll HealthTraumatic incidentWork life balanceWorkloadNone of the aboveProfessional DevelopmentOpportunities for promotionStaff moraleWorkplace issuePhysical environmentWorklife balanceStress and pressure supportPerformance of supervisorPeer supportInitiativeSkillsCoachCareer AspirationsFeedbackFurther PDCommunicationMy sayInformationKept informedWellness programsHealth & SafetyGenderAgeAboriginalTorres StraitSouth SeaDisabilityNESB
01Ill Health Retirement08/201219842004Public ServantA01-A04Central OfficeCorporate Strategy and PeformancePermanent Full-timeTrueFalseFalseTrueFalseFalseTrueFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueAANNNAAAANNNAAANAANNNMale56-60NaNNaNNaNNaNYes
12Voluntary Early Retirement (VER)08/2012Not StatedNot StatedPublic ServantAO5-AO7Central OfficeCorporate Strategy and PeformancePermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseAANNNNAAANNNAAANAANNNMale56-60NaNNaNNaNNaNNaN
23Voluntary Early Retirement (VER)05/201220112011Schools OfficerNaNCentral OfficeEducation QueenslandPermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueNNNNNNNNNNNNNNNAANNNNMale61 or olderNaNNaNNaNNaNNaN
34Resignation-Other reasons05/201220052006TeacherPrimaryCentral QueenslandNaNPermanent Full-timeFalseTrueFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseANNNAANNAAAAAAAAAAANAFemale36-40NaNNaNNaNNaNNaN
45Age Retirement05/201219701989Head of Curriculum/Head of Special EducationNaNSouth EastNaNPermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseAANNDDNAAAAAASASADDANAMFemale61 or olderNaNNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " ID SeparationType Cease Date DETE Start Date \\\n", "0 1 Ill Health Retirement 08/2012 1984 \n", "1 2 Voluntary Early Retirement (VER) 08/2012 Not Stated \n", "2 3 Voluntary Early Retirement (VER) 05/2012 2011 \n", "3 4 Resignation-Other reasons 05/2012 2005 \n", "4 5 Age Retirement 05/2012 1970 \n", "\n", " Role Start Date Position \\\n", "0 2004 Public Servant \n", "1 Not Stated Public Servant \n", "2 2011 Schools Officer \n", "3 2006 Teacher \n", "4 1989 Head of Curriculum/Head of Special Education \n", "\n", " Classification Region Business Unit \\\n", "0 A01-A04 Central Office Corporate Strategy and Peformance \n", "1 AO5-AO7 Central Office Corporate Strategy and Peformance \n", "2 NaN Central Office Education Queensland \n", "3 Primary Central Queensland NaN \n", "4 NaN South East NaN \n", "\n", " Employment Status Career move to public sector \\\n", "0 Permanent Full-time True \n", "1 Permanent Full-time False \n", "2 Permanent Full-time False \n", "3 Permanent Full-time False \n", "4 Permanent Full-time False \n", "\n", " Career move to private sector Interpersonal conflicts \\\n", "0 False False \n", "1 False False \n", "2 False False \n", "3 True False \n", "4 False False \n", "\n", " Job dissatisfaction Dissatisfaction with the department \\\n", "0 True False \n", "1 False False \n", "2 False False \n", "3 False False \n", "4 False False \n", "\n", " Physical work environment Lack of recognition Lack of job security \\\n", "0 False True False \n", "1 False False False \n", "2 False False False \n", "3 False False False \n", "4 False False False \n", "\n", " Work location Employment conditions Maternity/family Relocation \\\n", "0 False False False False \n", "1 False False False False \n", "2 False False False False \n", "3 False False False False \n", "4 False False False False \n", "\n", " Study/Travel Ill Health Traumatic incident Work life balance Workload \\\n", "0 False False False False False \n", "1 False False False False False \n", "2 False False False False False \n", "3 False False False False False \n", "4 False False False True False \n", "\n", " None of the above Professional Development Opportunities for promotion \\\n", "0 True A A \n", "1 False A A \n", "2 True N N \n", "3 False A N \n", "4 False A A \n", "\n", " Staff morale Workplace issue Physical environment Worklife balance \\\n", "0 N N N A \n", "1 N N N N \n", "2 N N N N \n", "3 N N A A \n", "4 N N D D \n", "\n", " Stress and pressure support Performance of supervisor Peer support \\\n", "0 A A A \n", "1 A A A \n", "2 N N N \n", "3 N N A \n", "4 N A A \n", "\n", " Initiative Skills Coach Career Aspirations Feedback Further PD \\\n", "0 N N N A A A \n", "1 N N N A A A \n", "2 N N N N N N \n", "3 A A A A A A \n", "4 A A A A SA SA \n", "\n", " Communication My say Information Kept informed Wellness programs \\\n", "0 N A A N N \n", "1 N A A N N \n", "2 A A N N N \n", "3 A A A A N \n", "4 D D A N A \n", "\n", " Health & Safety Gender Age Aboriginal Torres Strait South Sea \\\n", "0 N Male 56-60 NaN NaN NaN \n", "1 N Male 56-60 NaN NaN NaN \n", "2 N Male 61 or older NaN NaN NaN \n", "3 A Female 36-40 NaN NaN NaN \n", "4 M Female 61 or older NaN NaN NaN \n", "\n", " Disability NESB \n", "0 NaN Yes \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN " ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Read in the data\n", "import pandas as pd\n", "import numpy as np\n", "dete_survey = pd.read_csv('dete_survey.csv')\n", "\n", "#Quick exploration of the data\n", "pd.options.display.max_columns = 150 # to avoid truncated output \n", "dete_survey.head()" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 822 entries, 0 to 821\n", "Data columns (total 56 columns):\n", "ID 822 non-null int64\n", "SeparationType 822 non-null object\n", "Cease Date 822 non-null object\n", "DETE Start Date 822 non-null object\n", "Role Start Date 822 non-null object\n", "Position 817 non-null object\n", "Classification 455 non-null object\n", "Region 822 non-null object\n", "Business Unit 126 non-null object\n", "Employment Status 817 non-null object\n", "Career move to public sector 822 non-null bool\n", "Career move to private sector 822 non-null bool\n", "Interpersonal conflicts 822 non-null bool\n", "Job dissatisfaction 822 non-null bool\n", "Dissatisfaction with the department 822 non-null bool\n", "Physical work environment 822 non-null bool\n", "Lack of recognition 822 non-null bool\n", "Lack of job security 822 non-null bool\n", "Work location 822 non-null bool\n", "Employment conditions 822 non-null bool\n", "Maternity/family 822 non-null bool\n", "Relocation 822 non-null bool\n", "Study/Travel 822 non-null bool\n", "Ill Health 822 non-null bool\n", "Traumatic incident 822 non-null bool\n", "Work life balance 822 non-null bool\n", "Workload 822 non-null bool\n", "None of the above 822 non-null bool\n", "Professional Development 808 non-null object\n", "Opportunities for promotion 735 non-null object\n", "Staff morale 816 non-null object\n", "Workplace issue 788 non-null object\n", "Physical environment 817 non-null object\n", "Worklife balance 815 non-null object\n", "Stress and pressure support 810 non-null object\n", "Performance of supervisor 813 non-null object\n", "Peer support 812 non-null object\n", "Initiative 813 non-null object\n", "Skills 811 non-null object\n", "Coach 767 non-null object\n", "Career Aspirations 746 non-null object\n", "Feedback 792 non-null object\n", "Further PD 768 non-null object\n", "Communication 814 non-null object\n", "My say 812 non-null object\n", "Information 816 non-null object\n", "Kept informed 813 non-null object\n", "Wellness programs 766 non-null object\n", "Health & Safety 793 non-null object\n", "Gender 798 non-null object\n", "Age 811 non-null object\n", "Aboriginal 16 non-null object\n", "Torres Strait 3 non-null object\n", "South Sea 7 non-null object\n", "Disability 23 non-null object\n", "NESB 32 non-null object\n", "dtypes: bool(18), int64(1), object(37)\n", "memory usage: 258.6+ KB\n" ] } ], "source": [ "dete_survey.info()" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Record IDInstituteWorkAreaCESSATION YEARReason for ceasing employmentContributing Factors. Career Move - Public SectorContributing Factors. Career Move - Private SectorContributing Factors. Career Move - Self-employmentContributing Factors. Ill HealthContributing Factors. Maternity/FamilyContributing Factors. DissatisfactionContributing Factors. Job DissatisfactionContributing Factors. Interpersonal ConflictContributing Factors. StudyContributing Factors. TravelContributing Factors. OtherContributing Factors. NONEMain Factor. Which of these was the main factor for leaving?InstituteViews. Topic:1. I feel the senior leadership had a clear vision and directionInstituteViews. Topic:2. I was given access to skills training to help me do my job betterInstituteViews. Topic:3. I was given adequate opportunities for personal developmentInstituteViews. Topic:4. I was given adequate opportunities for promotion within %Institute]Q25LBL%InstituteViews. Topic:5. I felt the salary for the job was right for the responsibilities I hadInstituteViews. Topic:6. The organisation recognised when staff did good workInstituteViews. Topic:7. Management was generally supportive of meInstituteViews. Topic:8. Management was generally supportive of my teamInstituteViews. Topic:9. I was kept informed of the changes in the organisation which would affect meInstituteViews. Topic:10. Staff morale was positive within the InstituteInstituteViews. Topic:11. If I had a workplace issue it was dealt with quicklyInstituteViews. Topic:12. If I had a workplace issue it was dealt with efficientlyInstituteViews. Topic:13. If I had a workplace issue it was dealt with discreetlyWorkUnitViews. Topic:14. I was satisfied with the quality of the management and supervision within my work unitWorkUnitViews. Topic:15. I worked well with my colleaguesWorkUnitViews. Topic:16. My job was challenging and interestingWorkUnitViews. Topic:17. I was encouraged to use my initiative in the course of my workWorkUnitViews. Topic:18. I had sufficient contact with other people in my jobWorkUnitViews. Topic:19. I was given adequate support and co-operation by my peers to enable me to do my jobWorkUnitViews. Topic:20. I was able to use the full range of my skills in my jobWorkUnitViews. Topic:21. I was able to use the full range of my abilities in my job. ; Category:Level of Agreement; Question:YOUR VIEWS ABOUT YOUR WORK UNIT]WorkUnitViews. Topic:22. I was able to use the full range of my knowledge in my jobWorkUnitViews. Topic:23. My job provided sufficient varietyWorkUnitViews. Topic:24. I was able to cope with the level of stress and pressure in my jobWorkUnitViews. Topic:25. My job allowed me to balance the demands of work and family to my satisfactionWorkUnitViews. Topic:26. My supervisor gave me adequate personal recognition and feedback on my performanceWorkUnitViews. Topic:27. My working environment was satisfactory e.g. sufficient space, good lighting, suitable seating and working areaWorkUnitViews. Topic:28. I was given the opportunity to mentor and coach others in order for me to pass on my skills and knowledge prior to my cessation dateWorkUnitViews. Topic:29. There was adequate communication between staff in my unitWorkUnitViews. Topic:30. Staff morale was positive within my work unitInduction. Did you undertake Workplace Induction?InductionInfo. Topic:Did you undertake a Corporate Induction?InductionInfo. Topic:Did you undertake a Institute Induction?InductionInfo. Topic: Did you undertake Team Induction?InductionInfo. Face to Face Topic:Did you undertake a Corporate Induction; Category:How it was conducted?InductionInfo. On-line Topic:Did you undertake a Corporate Induction; Category:How it was conducted?InductionInfo. Induction Manual Topic:Did you undertake a Corporate Induction?InductionInfo. Face to Face Topic:Did you undertake a Institute Induction?InductionInfo. On-line Topic:Did you undertake a Institute Induction?InductionInfo. Induction Manual Topic:Did you undertake a Institute Induction?InductionInfo. Face to Face Topic: Did you undertake Team Induction; Category?InductionInfo. On-line Topic: Did you undertake Team Induction?process you undertook and how it was conducted.]InductionInfo. Induction Manual Topic: Did you undertake Team Induction?Workplace. Topic:Did you and your Manager develop a Performance and Professional Development Plan (PPDP)?Workplace. Topic:Does your workplace promote a work culture free from all forms of unlawful discrimination?Workplace. Topic:Does your workplace promote and practice the principles of employment equity?Workplace. Topic:Does your workplace value the diversity of its employees?Workplace. Topic:Would you recommend the Institute as an employer to others?Gender. What is your Gender?CurrentAge. Current AgeEmployment Type. Employment TypeClassification. ClassificationLengthofServiceOverall. Overall Length of Service at Institute (in years)LengthofServiceCurrent. Length of Service at current workplace (in years)
06.341330e+17Southern Queensland Institute of TAFENon-Delivery (corporate)2010.0Contract ExpiredNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNAgreeAgreeAgreeNeutralAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeStrongly AgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeNeutralAgreeAgreeYesYesYesYesFace to Face--Face to Face--Face to Face--YesYesYesYesYesFemale26 30Temporary Full-timeAdministration (AO)1-21-2
16.341337e+17Mount Isa Institute of TAFENon-Delivery (corporate)2010.0Retirement---------Travel--NaNAgreeAgreeAgreeAgreeAgreeStrongly AgreeStrongly AgreeAgreeStrongly AgreeAgreeAgreeAgreeDisagreeStrongly AgreeStrongly AgreeStrongly AgreeAgreeAgreeAgreeStrongly AgreeAgreeAgreeAgreeStrongly AgreeAgreeStrongly AgreeStrongly AgreeAgreeAgreeStrongly AgreeNoNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNYesYesYesYesYesNaNNaNNaNNaNNaNNaN
26.341388e+17Mount Isa Institute of TAFEDelivery (teaching)2010.0Retirement-----------NONENaNAgreeAgreeAgreeAgreeAgreeAgreeStrongly AgreeAgreeAgreeAgreeAgreeNeutralNeutralStrongly AgreeStrongly AgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeNoNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNYesYesYesYesYesNaNNaNNaNNaNNaNNaN
36.341399e+17Mount Isa Institute of TAFENon-Delivery (corporate)2010.0Resignation---------Travel--NaNAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeAgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeYesNoYesYes---NaN-----YesYesYesYesYesNaNNaNNaNNaNNaNNaN
46.341466e+17Southern Queensland Institute of TAFEDelivery (teaching)2010.0Resignation-Career Move - Private Sector----------NaNAgreeAgreeStrongly AgreeAgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeAgreeStrongly AgreeStrongly AgreeAgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeStrongly AgreeYesYesYesYes--Induction ManualFace to Face--Face to Face--YesYesYesYesYesMale41 45Permanent Full-timeTeacher (including LVT)3-43-4
\n", "
" ], "text/plain": [ " Record ID Institute \\\n", "0 6.341330e+17 Southern Queensland Institute of TAFE \n", "1 6.341337e+17 Mount Isa Institute of TAFE \n", "2 6.341388e+17 Mount Isa Institute of TAFE \n", "3 6.341399e+17 Mount Isa Institute of TAFE \n", "4 6.341466e+17 Southern Queensland Institute of TAFE \n", "\n", " WorkArea CESSATION YEAR Reason for ceasing employment \\\n", "0 Non-Delivery (corporate) 2010.0 Contract Expired \n", "1 Non-Delivery (corporate) 2010.0 Retirement \n", "2 Delivery (teaching) 2010.0 Retirement \n", "3 Non-Delivery (corporate) 2010.0 Resignation \n", "4 Delivery (teaching) 2010.0 Resignation \n", "\n", " Contributing Factors. Career Move - Public Sector \\\n", "0 NaN \n", "1 - \n", "2 - \n", "3 - \n", "4 - \n", "\n", " Contributing Factors. Career Move - Private Sector \\\n", "0 NaN \n", "1 - \n", "2 - \n", "3 - \n", "4 Career Move - Private Sector \n", "\n", " Contributing Factors. Career Move - Self-employment \\\n", "0 NaN \n", "1 - \n", "2 - \n", "3 - \n", "4 - \n", "\n", " Contributing Factors. Ill Health Contributing Factors. Maternity/Family \\\n", "0 NaN NaN \n", "1 - - \n", "2 - - \n", "3 - - \n", "4 - - \n", "\n", " Contributing Factors. Dissatisfaction \\\n", "0 NaN \n", "1 - \n", "2 - \n", "3 - \n", "4 - \n", "\n", " Contributing Factors. Job Dissatisfaction \\\n", "0 NaN \n", "1 - \n", "2 - \n", "3 - \n", "4 - \n", "\n", " Contributing Factors. Interpersonal Conflict Contributing Factors. Study \\\n", "0 NaN NaN \n", "1 - - \n", "2 - - \n", "3 - - \n", "4 - - \n", "\n", " Contributing Factors. Travel Contributing Factors. Other \\\n", "0 NaN NaN \n", "1 Travel - \n", "2 - - \n", "3 Travel - \n", "4 - - \n", "\n", " Contributing Factors. NONE \\\n", "0 NaN \n", "1 - \n", "2 NONE \n", "3 - \n", "4 - \n", "\n", " Main Factor. Which of these was the main factor for leaving? \\\n", "0 NaN \n", "1 NaN \n", "2 NaN \n", "3 NaN \n", "4 NaN \n", "\n", " InstituteViews. Topic:1. I feel the senior leadership had a clear vision and direction \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Agree \n", "\n", " InstituteViews. Topic:2. I was given access to skills training to help me do my job better \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Agree \n", "\n", " InstituteViews. Topic:3. I was given adequate opportunities for personal development \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:4. I was given adequate opportunities for promotion within %Institute]Q25LBL% \\\n", "0 Neutral \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Agree \n", "\n", " InstituteViews. Topic:5. I felt the salary for the job was right for the responsibilities I had \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:6. The organisation recognised when staff did good work \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:7. Management was generally supportive of me \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Strongly Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:8. Management was generally supportive of my team \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:9. I was kept informed of the changes in the organisation which would affect me \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Agree \n", "4 Agree \n", "\n", " InstituteViews. Topic:10. Staff morale was positive within the Institute \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:11. If I had a workplace issue it was dealt with quickly \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " InstituteViews. Topic:12. If I had a workplace issue it was dealt with efficiently \\\n", "0 Agree \n", "1 Agree \n", "2 Neutral \n", "3 Agree \n", "4 Agree \n", "\n", " InstituteViews. Topic:13. If I had a workplace issue it was dealt with discreetly \\\n", "0 Agree \n", "1 Disagree \n", "2 Neutral \n", "3 Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:14. I was satisfied with the quality of the management and supervision within my work unit \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Strongly Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:15. I worked well with my colleagues \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Strongly Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:16. My job was challenging and interesting \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:17. I was encouraged to use my initiative in the course of my work \\\n", "0 Strongly Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:18. I had sufficient contact with other people in my job \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:19. I was given adequate support and co-operation by my peers to enable me to do my job \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:20. I was able to use the full range of my skills in my job \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:21. I was able to use the full range of my abilities in my job. ; Category:Level of Agreement; Question:YOUR VIEWS ABOUT YOUR WORK UNIT] \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:22. I was able to use the full range of my knowledge in my job \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:23. My job provided sufficient variety \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:24. I was able to cope with the level of stress and pressure in my job \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:25. My job allowed me to balance the demands of work and family to my satisfaction \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:26. My supervisor gave me adequate personal recognition and feedback on my performance \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:27. My working environment was satisfactory e.g. sufficient space, good lighting, suitable seating and working area \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:28. I was given the opportunity to mentor and coach others in order for me to pass on my skills and knowledge prior to my cessation date \\\n", "0 Neutral \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:29. There was adequate communication between staff in my unit \\\n", "0 Agree \n", "1 Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " WorkUnitViews. Topic:30. Staff morale was positive within my work unit \\\n", "0 Agree \n", "1 Strongly Agree \n", "2 Agree \n", "3 Strongly Agree \n", "4 Strongly Agree \n", "\n", " Induction. Did you undertake Workplace Induction? \\\n", "0 Yes \n", "1 No \n", "2 No \n", "3 Yes \n", "4 Yes \n", "\n", " InductionInfo. Topic:Did you undertake a Corporate Induction? \\\n", "0 Yes \n", "1 NaN \n", "2 NaN \n", "3 No \n", "4 Yes \n", "\n", " InductionInfo. Topic:Did you undertake a Institute Induction? \\\n", "0 Yes \n", "1 NaN \n", "2 NaN \n", "3 Yes \n", "4 Yes \n", "\n", " InductionInfo. Topic: Did you undertake Team Induction? \\\n", "0 Yes \n", "1 NaN \n", "2 NaN \n", "3 Yes \n", "4 Yes \n", "\n", " InductionInfo. Face to Face Topic:Did you undertake a Corporate Induction; Category:How it was conducted? \\\n", "0 Face to Face \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " InductionInfo. On-line Topic:Did you undertake a Corporate Induction; Category:How it was conducted? \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " InductionInfo. Induction Manual Topic:Did you undertake a Corporate Induction? \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 Induction Manual \n", "\n", " InductionInfo. Face to Face Topic:Did you undertake a Institute Induction? \\\n", "0 Face to Face \n", "1 NaN \n", "2 NaN \n", "3 NaN \n", "4 Face to Face \n", "\n", " InductionInfo. On-line Topic:Did you undertake a Institute Induction? \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " InductionInfo. Induction Manual Topic:Did you undertake a Institute Induction? \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " InductionInfo. Face to Face Topic: Did you undertake Team Induction; Category? \\\n", "0 Face to Face \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 Face to Face \n", "\n", " InductionInfo. On-line Topic: Did you undertake Team Induction?process you undertook and how it was conducted.] \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " InductionInfo. Induction Manual Topic: Did you undertake Team Induction? \\\n", "0 - \n", "1 NaN \n", "2 NaN \n", "3 - \n", "4 - \n", "\n", " Workplace. Topic:Did you and your Manager develop a Performance and Professional Development Plan (PPDP)? \\\n", "0 Yes \n", "1 Yes \n", "2 Yes \n", "3 Yes \n", "4 Yes \n", "\n", " Workplace. Topic:Does your workplace promote a work culture free from all forms of unlawful discrimination? \\\n", "0 Yes \n", "1 Yes \n", "2 Yes \n", "3 Yes \n", "4 Yes \n", "\n", " Workplace. Topic:Does your workplace promote and practice the principles of employment equity? \\\n", "0 Yes \n", "1 Yes \n", "2 Yes \n", "3 Yes \n", "4 Yes \n", "\n", " Workplace. Topic:Does your workplace value the diversity of its employees? \\\n", "0 Yes \n", "1 Yes \n", "2 Yes \n", "3 Yes \n", "4 Yes \n", "\n", " Workplace. Topic:Would you recommend the Institute as an employer to others? \\\n", "0 Yes \n", "1 Yes \n", "2 Yes \n", "3 Yes \n", "4 Yes \n", "\n", " Gender. What is your Gender? CurrentAge. Current Age \\\n", "0 Female 26 30 \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 Male 41 45 \n", "\n", " Employment Type. Employment Type Classification. Classification \\\n", "0 Temporary Full-time Administration (AO) \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 Permanent Full-time Teacher (including LVT) \n", "\n", " LengthofServiceOverall. Overall Length of Service at Institute (in years) \\\n", "0 1-2 \n", "1 NaN \n", "2 NaN \n", "3 NaN \n", "4 3-4 \n", "\n", " LengthofServiceCurrent. Length of Service at current workplace (in years) \n", "0 1-2 \n", "1 NaN \n", "2 NaN \n", "3 NaN \n", "4 3-4 " ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Read in the data\n", "tafe_survey = pd.read_csv(\"tafe_survey.csv\")\n", "\n", "#Quick exploration of the data\n", "tafe_survey.head()" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 702 entries, 0 to 701\n", "Data columns (total 72 columns):\n", "Record ID 702 non-null float64\n", "Institute 702 non-null object\n", "WorkArea 702 non-null object\n", "CESSATION YEAR 695 non-null float64\n", "Reason for ceasing employment 701 non-null object\n", "Contributing Factors. Career Move - Public Sector 437 non-null object\n", "Contributing Factors. Career Move - Private Sector 437 non-null object\n", "Contributing Factors. Career Move - Self-employment 437 non-null object\n", "Contributing Factors. Ill Health 437 non-null object\n", "Contributing Factors. Maternity/Family 437 non-null object\n", "Contributing Factors. Dissatisfaction 437 non-null object\n", "Contributing Factors. Job Dissatisfaction 437 non-null object\n", "Contributing Factors. Interpersonal Conflict 437 non-null object\n", "Contributing Factors. Study 437 non-null object\n", "Contributing Factors. Travel 437 non-null object\n", "Contributing Factors. Other 437 non-null object\n", "Contributing Factors. NONE 437 non-null object\n", "Main Factor. Which of these was the main factor for leaving? 113 non-null object\n", "InstituteViews. Topic:1. I feel the senior leadership had a clear vision and direction 608 non-null object\n", "InstituteViews. Topic:2. I was given access to skills training to help me do my job better 613 non-null object\n", "InstituteViews. Topic:3. I was given adequate opportunities for personal development 610 non-null object\n", "InstituteViews. Topic:4. I was given adequate opportunities for promotion within %Institute]Q25LBL% 608 non-null object\n", "InstituteViews. Topic:5. I felt the salary for the job was right for the responsibilities I had 615 non-null object\n", "InstituteViews. Topic:6. The organisation recognised when staff did good work 607 non-null object\n", "InstituteViews. Topic:7. Management was generally supportive of me 614 non-null object\n", "InstituteViews. Topic:8. Management was generally supportive of my team 608 non-null object\n", "InstituteViews. Topic:9. I was kept informed of the changes in the organisation which would affect me 610 non-null object\n", "InstituteViews. Topic:10. Staff morale was positive within the Institute 602 non-null object\n", "InstituteViews. Topic:11. If I had a workplace issue it was dealt with quickly 601 non-null object\n", "InstituteViews. Topic:12. If I had a workplace issue it was dealt with efficiently 597 non-null object\n", "InstituteViews. Topic:13. If I had a workplace issue it was dealt with discreetly 601 non-null object\n", "WorkUnitViews. Topic:14. I was satisfied with the quality of the management and supervision within my work unit 609 non-null object\n", "WorkUnitViews. Topic:15. I worked well with my colleagues 605 non-null object\n", "WorkUnitViews. Topic:16. My job was challenging and interesting 607 non-null object\n", "WorkUnitViews. Topic:17. I was encouraged to use my initiative in the course of my work 610 non-null object\n", "WorkUnitViews. Topic:18. I had sufficient contact with other people in my job 613 non-null object\n", "WorkUnitViews. Topic:19. I was given adequate support and co-operation by my peers to enable me to do my job 609 non-null object\n", "WorkUnitViews. Topic:20. I was able to use the full range of my skills in my job 609 non-null object\n", "WorkUnitViews. Topic:21. I was able to use the full range of my abilities in my job. ; Category:Level of Agreement; Question:YOUR VIEWS ABOUT YOUR WORK UNIT] 608 non-null object\n", "WorkUnitViews. Topic:22. I was able to use the full range of my knowledge in my job 608 non-null object\n", "WorkUnitViews. Topic:23. My job provided sufficient variety 611 non-null object\n", "WorkUnitViews. Topic:24. I was able to cope with the level of stress and pressure in my job 610 non-null object\n", "WorkUnitViews. Topic:25. My job allowed me to balance the demands of work and family to my satisfaction 611 non-null object\n", "WorkUnitViews. Topic:26. My supervisor gave me adequate personal recognition and feedback on my performance 606 non-null object\n", "WorkUnitViews. Topic:27. My working environment was satisfactory e.g. sufficient space, good lighting, suitable seating and working area 610 non-null object\n", "WorkUnitViews. Topic:28. I was given the opportunity to mentor and coach others in order for me to pass on my skills and knowledge prior to my cessation date 609 non-null object\n", "WorkUnitViews. Topic:29. There was adequate communication between staff in my unit 603 non-null object\n", "WorkUnitViews. Topic:30. Staff morale was positive within my work unit 606 non-null object\n", "Induction. Did you undertake Workplace Induction? 619 non-null object\n", "InductionInfo. Topic:Did you undertake a Corporate Induction? 432 non-null object\n", "InductionInfo. Topic:Did you undertake a Institute Induction? 483 non-null object\n", "InductionInfo. Topic: Did you undertake Team Induction? 440 non-null object\n", "InductionInfo. Face to Face Topic:Did you undertake a Corporate Induction; Category:How it was conducted? 555 non-null object\n", "InductionInfo. On-line Topic:Did you undertake a Corporate Induction; Category:How it was conducted? 555 non-null object\n", "InductionInfo. Induction Manual Topic:Did you undertake a Corporate Induction? 555 non-null object\n", "InductionInfo. Face to Face Topic:Did you undertake a Institute Induction? 530 non-null object\n", "InductionInfo. On-line Topic:Did you undertake a Institute Induction? 555 non-null object\n", "InductionInfo. Induction Manual Topic:Did you undertake a Institute Induction? 553 non-null object\n", "InductionInfo. Face to Face Topic: Did you undertake Team Induction; Category? 555 non-null object\n", "InductionInfo. On-line Topic: Did you undertake Team Induction?process you undertook and how it was conducted.] 555 non-null object\n", "InductionInfo. Induction Manual Topic: Did you undertake Team Induction? 555 non-null object\n", "Workplace. Topic:Did you and your Manager develop a Performance and Professional Development Plan (PPDP)? 608 non-null object\n", "Workplace. Topic:Does your workplace promote a work culture free from all forms of unlawful discrimination? 594 non-null object\n", "Workplace. Topic:Does your workplace promote and practice the principles of employment equity? 587 non-null object\n", "Workplace. Topic:Does your workplace value the diversity of its employees? 586 non-null object\n", "Workplace. Topic:Would you recommend the Institute as an employer to others? 581 non-null object\n", "Gender. What is your Gender? 596 non-null object\n", "CurrentAge. Current Age 596 non-null object\n", "Employment Type. Employment Type 596 non-null object\n", "Classification. Classification 596 non-null object\n", "LengthofServiceOverall. Overall Length of Service at Institute (in years) 596 non-null object\n", "LengthofServiceCurrent. Length of Service at current workplace (in years) 596 non-null object\n", "dtypes: float64(2), object(70)\n", "memory usage: 395.0+ KB\n" ] } ], "source": [ "tafe_survey.info()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can make the following observations based on the work above:\n", " - The `dete_survey` dataframe contains `'Not Stated'` values that indicate values are missing, but they aren't represented as `NaN`.\n", " - Both the `dete_survey` and `tafe_survey` contain many columns that we don't need to complete our analysis.\n", " - Each dataframe contains many of the same columns, but the column names are different.\n", " - There are multiple columns/answers that indicate an employee resigned because they were dissatisfied." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Identify Missing Values and Drop Unneccessary Columns\n", "\n", "First, we'll correct the `Not Stated` values and drop some of the columns we don't need for our analysis." ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDSeparationTypeCease DateDETE Start DateRole Start DatePositionClassificationRegionBusiness UnitEmployment StatusCareer move to public sectorCareer move to private sectorInterpersonal conflictsJob dissatisfactionDissatisfaction with the departmentPhysical work environmentLack of recognitionLack of job securityWork locationEmployment conditionsMaternity/familyRelocationStudy/TravelIll HealthTraumatic incidentWork life balanceWorkloadNone of the aboveProfessional DevelopmentOpportunities for promotionStaff moraleWorkplace issuePhysical environmentWorklife balanceStress and pressure supportPerformance of supervisorPeer supportInitiativeSkillsCoachCareer AspirationsFeedbackFurther PDCommunicationMy sayInformationKept informedWellness programsHealth & SafetyGenderAgeAboriginalTorres StraitSouth SeaDisabilityNESB
01Ill Health Retirement08/20121984.02004.0Public ServantA01-A04Central OfficeCorporate Strategy and PeformancePermanent Full-timeTrueFalseFalseTrueFalseFalseTrueFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueAANNNAAAANNNAAANAANNNMale56-60NaNNaNNaNNaNYes
12Voluntary Early Retirement (VER)08/2012NaNNaNPublic ServantAO5-AO7Central OfficeCorporate Strategy and PeformancePermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseAANNNNAAANNNAAANAANNNMale56-60NaNNaNNaNNaNNaN
23Voluntary Early Retirement (VER)05/20122011.02011.0Schools OfficerNaNCentral OfficeEducation QueenslandPermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueNNNNNNNNNNNNNNNAANNNNMale61 or olderNaNNaNNaNNaNNaN
34Resignation-Other reasons05/20122005.02006.0TeacherPrimaryCentral QueenslandNaNPermanent Full-timeFalseTrueFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseANNNAANNAAAAAAAAAAANAFemale36-40NaNNaNNaNNaNNaN
45Age Retirement05/20121970.01989.0Head of Curriculum/Head of Special EducationNaNSouth EastNaNPermanent Full-timeFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseTrueFalseFalseAANNDDNAAAAAASASADDANAMFemale61 or olderNaNNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " ID SeparationType Cease Date DETE Start Date \\\n", "0 1 Ill Health Retirement 08/2012 1984.0 \n", "1 2 Voluntary Early Retirement (VER) 08/2012 NaN \n", "2 3 Voluntary Early Retirement (VER) 05/2012 2011.0 \n", "3 4 Resignation-Other reasons 05/2012 2005.0 \n", "4 5 Age Retirement 05/2012 1970.0 \n", "\n", " Role Start Date Position \\\n", "0 2004.0 Public Servant \n", "1 NaN Public Servant \n", "2 2011.0 Schools Officer \n", "3 2006.0 Teacher \n", "4 1989.0 Head of Curriculum/Head of Special Education \n", "\n", " Classification Region Business Unit \\\n", "0 A01-A04 Central Office Corporate Strategy and Peformance \n", "1 AO5-AO7 Central Office Corporate Strategy and Peformance \n", "2 NaN Central Office Education Queensland \n", "3 Primary Central Queensland NaN \n", "4 NaN South East NaN \n", "\n", " Employment Status Career move to public sector \\\n", "0 Permanent Full-time True \n", "1 Permanent Full-time False \n", "2 Permanent Full-time False \n", "3 Permanent Full-time False \n", "4 Permanent Full-time False \n", "\n", " Career move to private sector Interpersonal conflicts \\\n", "0 False False \n", "1 False False \n", "2 False False \n", "3 True False \n", "4 False False \n", "\n", " Job dissatisfaction Dissatisfaction with the department \\\n", "0 True False \n", "1 False False \n", "2 False False \n", "3 False False \n", "4 False False \n", "\n", " Physical work environment Lack of recognition Lack of job security \\\n", "0 False True False \n", "1 False False False \n", "2 False False False \n", "3 False False False \n", "4 False False False \n", "\n", " Work location Employment conditions Maternity/family Relocation \\\n", "0 False False False False \n", "1 False False False False \n", "2 False False False False \n", "3 False False False False \n", "4 False False False False \n", "\n", " Study/Travel Ill Health Traumatic incident Work life balance Workload \\\n", "0 False False False False False \n", "1 False False False False False \n", "2 False False False False False \n", "3 False False False False False \n", "4 False False False True False \n", "\n", " None of the above Professional Development Opportunities for promotion \\\n", "0 True A A \n", "1 False A A \n", "2 True N N \n", "3 False A N \n", "4 False A A \n", "\n", " Staff morale Workplace issue Physical environment Worklife balance \\\n", "0 N N N A \n", "1 N N N N \n", "2 N N N N \n", "3 N N A A \n", "4 N N D D \n", "\n", " Stress and pressure support Performance of supervisor Peer support \\\n", "0 A A A \n", "1 A A A \n", "2 N N N \n", "3 N N A \n", "4 N A A \n", "\n", " Initiative Skills Coach Career Aspirations Feedback Further PD \\\n", "0 N N N A A A \n", "1 N N N A A A \n", "2 N N N N N N \n", "3 A A A A A A \n", "4 A A A A SA SA \n", "\n", " Communication My say Information Kept informed Wellness programs \\\n", "0 N A A N N \n", "1 N A A N N \n", "2 A A N N N \n", "3 A A A A N \n", "4 D D A N A \n", "\n", " Health & Safety Gender Age Aboriginal Torres Strait South Sea \\\n", "0 N Male 56-60 NaN NaN NaN \n", "1 N Male 56-60 NaN NaN NaN \n", "2 N Male 61 or older NaN NaN NaN \n", "3 A Female 36-40 NaN NaN NaN \n", "4 M Female 61 or older NaN NaN NaN \n", "\n", " Disability NESB \n", "0 NaN Yes \n", "1 NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN " ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Read in the data again, but this time read `Not Stated` values as `NaN`\n", "dete_survey = pd.read_csv('dete_survey.csv', na_values='Not Stated')\n", "\n", "# Quick exploration of the data\n", "dete_survey.head()" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['ID', 'SeparationType', 'Cease Date', 'DETE Start Date',\n", " 'Role Start Date', 'Position', 'Classification', 'Region',\n", " 'Business Unit', 'Employment Status', 'Career move to public sector',\n", " 'Career move to private sector', 'Interpersonal conflicts',\n", " 'Job dissatisfaction', 'Dissatisfaction with the department',\n", " 'Physical work environment', 'Lack of recognition',\n", " 'Lack of job security', 'Work location', 'Employment conditions',\n", " 'Maternity/family', 'Relocation', 'Study/Travel', 'Ill Health',\n", " 'Traumatic incident', 'Work life balance', 'Workload',\n", " 'None of the above', 'Gender', 'Age', 'Aboriginal', 'Torres Strait',\n", " 'South Sea', 'Disability', 'NESB'],\n", " dtype='object')\n", "Index(['Record ID', 'Institute', 'WorkArea', 'CESSATION YEAR',\n", " 'Reason for ceasing employment',\n", " 'Contributing Factors. Career Move - Public Sector ',\n", " 'Contributing Factors. Career Move - Private Sector ',\n", " 'Contributing Factors. Career Move - Self-employment',\n", " 'Contributing Factors. Ill Health',\n", " 'Contributing Factors. Maternity/Family',\n", " 'Contributing Factors. Dissatisfaction',\n", " 'Contributing Factors. Job Dissatisfaction',\n", " 'Contributing Factors. Interpersonal Conflict',\n", " 'Contributing Factors. Study', 'Contributing Factors. Travel',\n", " 'Contributing Factors. Other', 'Contributing Factors. NONE',\n", " 'Gender. What is your Gender?', 'CurrentAge. Current Age',\n", " 'Employment Type. Employment Type', 'Classification. Classification',\n", " 'LengthofServiceOverall. Overall Length of Service at Institute (in years)',\n", " 'LengthofServiceCurrent. Length of Service at current workplace (in years)'],\n", " dtype='object')\n" ] } ], "source": [ "# Remove columns we don't need for our analysis\n", "dete_survey_updated = dete_survey.drop(dete_survey.columns[28:49], axis=1)\n", "tafe_survey_updated = tafe_survey.drop(tafe_survey.columns[17:66], axis=1)\n", "\n", "#Check that the columns were dropped\n", "print(dete_survey_updated.columns)\n", "print(tafe_survey_updated.columns)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Rename Columns\n", "\n", "Next, we'll standardize the names of the columns we want to work with, because we eventually want to combine the dataframes." ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['id', 'separationtype', 'cease_date', 'dete_start_date',\n", " 'role_start_date', 'position', 'classification', 'region',\n", " 'business_unit', 'employment_status', 'career_move_to_public_sector',\n", " 'career_move_to_private_sector', 'interpersonal_conflicts',\n", " 'job_dissatisfaction', 'dissatisfaction_with_the_department',\n", " 'physical_work_environment', 'lack_of_recognition',\n", " 'lack_of_job_security', 'work_location', 'employment_conditions',\n", " 'maternity/family', 'relocation', 'study/travel', 'ill_health',\n", " 'traumatic_incident', 'work_life_balance', 'workload',\n", " 'none_of_the_above', 'gender', 'age', 'aboriginal', 'torres_strait',\n", " 'south_sea', 'disability', 'nesb'],\n", " dtype='object')" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Clean the column names\n", "dete_survey_updated.columns = dete_survey_updated.columns.str.lower().str.strip().str.replace(' ', '_')\n", "\n", "# Check that the column names were updated correctly\n", "dete_survey_updated.columns" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['id', 'Institute', 'WorkArea', 'cease_date', 'separationtype',\n", " 'Contributing Factors. Career Move - Public Sector ',\n", " 'Contributing Factors. Career Move - Private Sector ',\n", " 'Contributing Factors. Career Move - Self-employment',\n", " 'Contributing Factors. Ill Health',\n", " 'Contributing Factors. Maternity/Family',\n", " 'Contributing Factors. Dissatisfaction',\n", " 'Contributing Factors. Job Dissatisfaction',\n", " 'Contributing Factors. Interpersonal Conflict',\n", " 'Contributing Factors. Study', 'Contributing Factors. Travel',\n", " 'Contributing Factors. Other', 'Contributing Factors. NONE', 'gender',\n", " 'age', 'employment_status', 'position', 'institute_service',\n", " 'role_service'],\n", " dtype='object')" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Update column names to match the names in dete_survey_updated\n", "mapping = {'Record ID': 'id', 'CESSATION YEAR': 'cease_date', 'Reason for ceasing employment': 'separationtype', 'Gender. What is your Gender?': 'gender', 'CurrentAge. Current Age': 'age',\n", " 'Employment Type. Employment Type': 'employment_status',\n", " 'Classification. Classification': 'position',\n", " 'LengthofServiceOverall. Overall Length of Service at Institute (in years)': 'institute_service',\n", " 'LengthofServiceCurrent. Length of Service at current workplace (in years)': 'role_service'}\n", "tafe_survey_updated = tafe_survey_updated.rename(mapping, axis = 1)\n", "\n", "# Check that the specified column names were updated correctly\n", "tafe_survey_updated.columns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Filter the Data\n", "\n", "For this project, we'll only analyze survey respondents who *resigned*, so we'll only select separation types containing the string `'Resignation'`." ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Resignation 340\n", "Contract Expired 127\n", "Retrenchment/ Redundancy 104\n", "Retirement 82\n", "Transfer 25\n", "Termination 23\n", "Name: separationtype, dtype: int64" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values for the separationtype column\n", "tafe_survey_updated['separationtype'].value_counts()" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Age Retirement 285\n", "Resignation-Other reasons 150\n", "Resignation-Other employer 91\n", "Resignation-Move overseas/interstate 70\n", "Voluntary Early Retirement (VER) 67\n", "Ill Health Retirement 61\n", "Other 49\n", "Contract Expired 34\n", "Termination 15\n", "Name: separationtype, dtype: int64" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values for the separationtype column\n", "dete_survey_updated['separationtype'].value_counts()" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Resignation 311\n", "Age Retirement 285\n", "Voluntary Early Retirement (VER) 67\n", "Ill Health Retirement 61\n", "Other 49\n", "Contract Expired 34\n", "Termination 15\n", "Name: separationtype, dtype: int64" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Update all separation types containing the word \"resignation\" to 'Resignation'\n", "dete_survey_updated['separationtype'] = dete_survey_updated['separationtype'].str.split('-').str[0]\n", "\n", "# Check the values in the separationtype column were updated correctly\n", "dete_survey_updated['separationtype'].value_counts()" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "# Select only the resignation separation types from each dataframe\n", "dete_resignations = dete_survey_updated[dete_survey_updated['separationtype'] == 'Resignation'].copy()\n", "tafe_resignations = tafe_survey_updated[tafe_survey_updated['separationtype'] == 'Resignation'].copy()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Verify the Data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below, we clean and explore the `cease_date` and `dete_start_date` columns to make sure all of the years make sense. We'll use the following criteria:\n", "\n", " - Since the `cease_date` is the last year of the person's employment and the `dete_start_date` is the person's first year of employment, it wouldn't make sense to have years after the current date. \n", " - Given that most people in this field start working in their 20s, it's also unlikely that the `dete_start_date` was before the year 1940." ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2012 126\n", "2013 74\n", "01/2014 22\n", "12/2013 17\n", "06/2013 14\n", "09/2013 11\n", "11/2013 9\n", "07/2013 9\n", "10/2013 6\n", "08/2013 4\n", "05/2012 2\n", "05/2013 2\n", "09/2010 1\n", "07/2006 1\n", "07/2012 1\n", "2010 1\n", "Name: cease_date, dtype: int64" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values\n", "dete_resignations['cease_date'].value_counts()" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2013.0 146\n", "2012.0 129\n", "2014.0 22\n", "2010.0 2\n", "2006.0 1\n", "Name: cease_date, dtype: int64" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Extract the years and convert them to a float type\n", "dete_resignations['cease_date'] = dete_resignations['cease_date'].str.split('/').str[-1]\n", "dete_resignations['cease_date'] = dete_resignations['cease_date'].astype(\"float\")\n", "\n", "# Check the values again and look for outliers\n", "dete_resignations['cease_date'].value_counts()" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1963.0 1\n", "1971.0 1\n", "1972.0 1\n", "1984.0 1\n", "1977.0 1\n", "1987.0 1\n", "1975.0 1\n", "1973.0 1\n", "1982.0 1\n", "1974.0 2\n", "1983.0 2\n", "1976.0 2\n", "1986.0 3\n", "1985.0 3\n", "2001.0 3\n", "1995.0 4\n", "1988.0 4\n", "1989.0 4\n", "1991.0 4\n", "1997.0 5\n", "1980.0 5\n", "1993.0 5\n", "1990.0 5\n", "1994.0 6\n", "2003.0 6\n", "1998.0 6\n", "1992.0 6\n", "2002.0 6\n", "1996.0 6\n", "1999.0 8\n", "2000.0 9\n", "2013.0 10\n", "2009.0 13\n", "2006.0 13\n", "2004.0 14\n", "2005.0 15\n", "2010.0 17\n", "2012.0 21\n", "2007.0 21\n", "2008.0 22\n", "2011.0 24\n", "Name: dete_start_date, dtype: int64" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values and look for outliers\n", "dete_resignations['dete_start_date'].value_counts().sort_values()" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2009.0 2\n", "2013.0 55\n", "2010.0 68\n", "2012.0 94\n", "2011.0 116\n", "Name: cease_date, dtype: int64" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values\n", "tafe_resignations['cease_date'].value_counts().sort_values()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below are our findings:\n", "- The years in both dataframes don't completely align. The `tafe_survey_updated` dataframe contains some cease dates in 2009, but the `dete_survey_updated` dataframe does not. The `tafe_survey_updated` dataframe also contains many more cease dates in 2010 than the `dete_survey_updaed` dataframe. Since we aren't concerned with analyzing the results by year, we'll leave them as is." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Create a New Column\n", "\n", "Since our end goal is to answer the question below, we need a column containing the length of time an employee spent in their workplace, or years of service, in both dataframes.\n", "\n", " - End goal: Are employees who have only worked for the institutes for a short period of time resigning due to some kind of dissatisfaction? What about employees who have been at the job longer?\n", "\n", "The `tafe_resignations` dataframe already contains a \"service\" column, which we renamed to `institute_service`.\n", "\n", "Below, we calculate the years of service in the `dete_survey_updated` dataframe by subtracting the `dete_start_date` from the `cease_date` and create a new column named `institute_service`." ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3 7.0\n", "5 18.0\n", "8 3.0\n", "9 15.0\n", "11 3.0\n", "Name: institute_service, dtype: float64" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Calculate the length of time an employee spent in their respective workplace and create a new column\n", "dete_resignations['institute_service'] = dete_resignations['cease_date'] - dete_resignations['dete_start_date']\n", "\n", "# Quick check of the result\n", "dete_resignations['institute_service'].head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Identify Dissatisfied Employees\n", "Next, we'll identify any employees who resigned because they were dissatisfied. Below are the columns we'll use to categorize employees as \"dissatisfied\" from each dataframe:\n", "\n", " 1. tafe_survey_updated:\n", " - `Contributing Factors. Dissatisfaction`\n", " - `Contributing Factors. Job Dissatisfaction`\n", " 2. dafe_survey_updated:\n", " - `job_dissatisfaction`\n", " - `dissatisfaction_with_the_department`\n", " - `physical_work_environment`\n", " - `lack_of_recognition`\n", " - `lack_of_job_security`\n", " - `work_location`\n", " - `employment_conditions`\n", " - `work_life_balance`\n", " - `workload`\n", " \n", "If the employee indicated any of the factors above caused them to resign, we'll mark them as `dissatisfied` in a new column. After our changes, the new `dissatisfied` column will contain just the following values:\n", "\n", " - `True`: indicates a person resigned because they were dissatisfied in some way\n", " - `False`: indicates a person resigned because of a reason other than dissatisfaction with the job\n", " - `NaN`: indicates the value is missing" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "- 277\n", "Contributing Factors. Dissatisfaction 55\n", "Name: Contributing Factors. Dissatisfaction, dtype: int64" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values\n", "tafe_resignations['Contributing Factors. Dissatisfaction'].value_counts()" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "- 270\n", "Job Dissatisfaction 62\n", "Name: Contributing Factors. Job Dissatisfaction, dtype: int64" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values\n", "tafe_resignations['Contributing Factors. Job Dissatisfaction'].value_counts()" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False 241\n", "True 91\n", "NaN 8\n", "Name: dissatisfied, dtype: int64" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Update the values in the contributing factors columns to be either True, False, or NaN\n", "def update_vals(x):\n", " if x == '-':\n", " return False\n", " elif pd.isnull(x):\n", " return np.nan\n", " else:\n", " return True\n", "tafe_resignations['dissatisfied'] = tafe_resignations[['Contributing Factors. Dissatisfaction', 'Contributing Factors. Job Dissatisfaction']].applymap(update_vals).any(1, skipna=False)\n", "tafe_resignations_up = tafe_resignations.copy()\n", "\n", "# Check the unique values after the updates\n", "tafe_resignations_up['dissatisfied'].value_counts(dropna=False)" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False 162\n", "True 149\n", "Name: dissatisfied, dtype: int64" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Update the values in columns related to dissatisfaction to be either True, False, or NaN\n", "dete_resignations['dissatisfied'] = dete_resignations[['job_dissatisfaction',\n", " 'dissatisfaction_with_the_department', 'physical_work_environment',\n", " 'lack_of_recognition', 'lack_of_job_security', 'work_location',\n", " 'employment_conditions', 'work_life_balance',\n", " 'workload']].any(1, skipna=False)\n", "dete_resignations_up = dete_resignations.copy()\n", "dete_resignations_up['dissatisfied'].value_counts(dropna=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Combining the Data\n", "\n", "Below, we'll add an institute column so that we can differentiate the data from each survey after we combine them. Then, we'll combine the dataframes and drop any remaining columns we don't need." ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "# Add an institute column\n", "dete_resignations_up['institute'] = 'DETE'\n", "tafe_resignations_up['institute'] = 'TAFE'" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:2: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version\n", "of pandas will change to not sort by default.\n", "\n", "To accept the future behavior, pass 'sort=False'.\n", "\n", "To retain the current behavior and silence the warning, pass 'sort=True'.\n", "\n", " \n" ] }, { "data": { "text/plain": [ "torres_strait 0\n", "south_sea 3\n", "aboriginal 7\n", "disability 8\n", "nesb 9\n", "business_unit 32\n", "classification 161\n", "region 265\n", "role_start_date 271\n", "dete_start_date 283\n", "role_service 290\n", "career_move_to_public_sector 311\n", "employment_conditions 311\n", "work_location 311\n", "lack_of_job_security 311\n", "job_dissatisfaction 311\n", "dissatisfaction_with_the_department 311\n", "workload 311\n", "lack_of_recognition 311\n", "interpersonal_conflicts 311\n", "maternity/family 311\n", "none_of_the_above 311\n", "physical_work_environment 311\n", "relocation 311\n", "study/travel 311\n", "traumatic_incident 311\n", "work_life_balance 311\n", "career_move_to_private_sector 311\n", "ill_health 311\n", "Contributing Factors. Career Move - Private Sector 332\n", "Contributing Factors. Other 332\n", "Contributing Factors. Career Move - Public Sector 332\n", "Contributing Factors. Career Move - Self-employment 332\n", "Contributing Factors. Travel 332\n", "Contributing Factors. Study 332\n", "Contributing Factors. Dissatisfaction 332\n", "Contributing Factors. Ill Health 332\n", "Contributing Factors. NONE 332\n", "Contributing Factors. Maternity/Family 332\n", "Contributing Factors. Job Dissatisfaction 332\n", "Contributing Factors. Interpersonal Conflict 332\n", "WorkArea 340\n", "Institute 340\n", "institute_service 563\n", "gender 592\n", "age 596\n", "employment_status 597\n", "position 598\n", "cease_date 635\n", "dissatisfied 643\n", "id 651\n", "separationtype 651\n", "institute 651\n", "dtype: int64" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Combine the dataframes\n", "combined = pd.concat([dete_resignations_up, tafe_resignations_up], ignore_index=True)\n", "\n", "# Verify the number of non null values in each column\n", "combined.notnull().sum().sort_values()" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [], "source": [ "# Drop columns with less than 500 non null values\n", "combined_updated = combined.dropna(thresh = 500, axis =1).copy()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Clean the Service Column \n", "\n", "Next, we'll clean the `institute_service` column and categorize employees according to the following definitions:\n", "\n", " - New: Less than 3 years in the workplace\n", " - Experienced: 3-6 years in the workplace\n", " - Established: 7-10 years in the workplace\n", " - Veteran: 11 or more years in the workplace\n", " \n", "Our analysis is based on [this article](https://www.businesswire.com/news/home/20171108006002/en/Age-Number-Engage-Employees-Career-Stage), which makes the argument that understanding employee's needs according to career stage instead of age is more effective." ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NaN 88\n", "Less than 1 year 73\n", "1-2 64\n", "3-4 63\n", "5-6 33\n", "11-20 26\n", "5.0 23\n", "1.0 22\n", "7-10 21\n", "0.0 20\n", "3.0 20\n", "6.0 17\n", "4.0 16\n", "9.0 14\n", "2.0 14\n", "7.0 13\n", "More than 20 years 10\n", "8.0 8\n", "13.0 8\n", "15.0 7\n", "20.0 7\n", "10.0 6\n", "12.0 6\n", "14.0 6\n", "17.0 6\n", "22.0 6\n", "18.0 5\n", "16.0 5\n", "11.0 4\n", "23.0 4\n", "24.0 4\n", "19.0 3\n", "32.0 3\n", "39.0 3\n", "21.0 3\n", "28.0 2\n", "30.0 2\n", "26.0 2\n", "36.0 2\n", "25.0 2\n", "29.0 1\n", "31.0 1\n", "27.0 1\n", "34.0 1\n", "35.0 1\n", "38.0 1\n", "41.0 1\n", "42.0 1\n", "49.0 1\n", "33.0 1\n", "Name: institute_service, dtype: int64" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check the unique values\n", "combined_updated['institute_service'].value_counts(dropna=False)" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0 159\n", "3.0 83\n", "5.0 56\n", "7.0 34\n", "11.0 30\n", "0.0 20\n", "20.0 17\n", "6.0 17\n", "4.0 16\n", "9.0 14\n", "2.0 14\n", "13.0 8\n", "8.0 8\n", "15.0 7\n", "17.0 6\n", "10.0 6\n", "12.0 6\n", "14.0 6\n", "22.0 6\n", "16.0 5\n", "18.0 5\n", "24.0 4\n", "23.0 4\n", "39.0 3\n", "19.0 3\n", "21.0 3\n", "32.0 3\n", "28.0 2\n", "36.0 2\n", "25.0 2\n", "30.0 2\n", "26.0 2\n", "29.0 1\n", "38.0 1\n", "42.0 1\n", "27.0 1\n", "41.0 1\n", "35.0 1\n", "49.0 1\n", "34.0 1\n", "33.0 1\n", "31.0 1\n", "Name: institute_service_up, dtype: int64" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Extract the years of service and convert the type to float\n", "combined_updated['institute_service_up'] = combined_updated['institute_service'].astype('str').str.extract(r'(\\d+)')\n", "combined_updated['institute_service_up'] = combined_updated['institute_service_up'].astype('float')\n", "\n", "# Check the years extracted are correct\n", "combined_updated['institute_service_up'].value_counts()" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "New 193\n", "Experienced 172\n", "Veteran 136\n", "Established 62\n", "Name: service_cat, dtype: int64" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Convert years of service to categories\n", "def transform_service(val):\n", " if val >= 11:\n", " return \"Veteran\"\n", " elif 7 <= val < 11:\n", " return \"Established\"\n", " elif 3 <= val < 7:\n", " return \"Experienced\"\n", " elif pd.isnull(val):\n", " return np.nan\n", " else:\n", " return \"New\"\n", "combined_updated['service_cat'] = combined_updated['institute_service_up'].apply(transform_service)\n", "\n", "# Quick check of the update\n", "combined_updated['service_cat'].value_counts()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Perform Some Initial Analysis " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we'll replace the missing values in the `dissatisfied` column with the most frequent value, `False`. Then, we'll calculate the percentage of employees who resigned due to dissatisfaction in each `service_cat` group and plot the results.\n", "\n", "Note that since we still have additional missing values left to deal with, this is meant to be an initial introduction to the analysis, *not* the final analysis." ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False 403\n", "True 240\n", "NaN 8\n", "Name: dissatisfied, dtype: int64" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Verify the unique values\n", "combined_updated['dissatisfied'].value_counts(dropna=False)" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "# Replace missing values with the most frequent value, False\n", "combined_updated['dissatisfied'] = combined_updated['dissatisfied'].fillna(False)" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEoCAYAAACjGLHcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xu81VWd//HXWy4SglqKZqIDGc5EIshFMpKcsgYvA/ZTB7B0KBVH0pyxTLoMNaSOt8TLj1J0rHQ0TNOGFAedvOSIGsd+YKEiaCSYUwymQoqCfH5/rHVoczpwNnLO2Wev834+Hjw8+7u/e591vp7z/q79+a61vooIzMysLDvUugFmZtb6HO5mZgVyuJuZFcjhbmZWIIe7mVmBHO5mZgVyuJuZFcjhbmZWIIe7mVmButbqG+++++7Rr1+/Wn17M7O69Pjjj/9vRPRpab+ahXu/fv1oaGio1bc3M6tLkn5TzX4uy5iZFcjhbmZWIIe7mVmBalZzt/KtX7+elStXsm7dulo3pVPo0aMHffv2pVu3brVuinUADndrMytXrqR3797069cPSbVuTtEigtWrV7Ny5Ur69+9f6+ZYB+CyjLWZdevWsdtuuznY24EkdtttN39Ksk0c7tamHOztx8faKjnczcwKVFTNvd/Uu2rdhKosv/CoWjehJlr7/8/bOY7f+MY36NWrF6+++iqjR4/m8MMP3/52LF/O/PnzOeGEEwBoaGjghhtu4Morr9zia8455xzmzp3LkUceyX777UfPnj056aSTqv6evXr1Yu3atdvdditXUeFuVq3p06e32nstX76cm2++eVO4Dx8+nOHDh2/1NbNmzeKll16iS5curdYOs0ouy1jxzj//fPbff38+/OEPs2TJEgAmTZrEbbfdBsDUqVMZOHAgBx54IF/84hcBuPXWWznggAMYPHgwo0ePBlKIH3rooQwdOpShQ4cyf/78Ta9/6KGHGDJkCDNmzOCBBx7g6KOPBuDBBx9kyJAhDBkyhIMOOog1a9YwduxY1q5dy7Bhw7jlllv4xje+waWXXgrAs88+y5gxYxg2bBiHHnooTz/9NAC//vWvOeSQQxg0aBBf+9rX2u/gWd1yz92K9vjjjzN79mwWLlzIhg0bGDp0KMOGDdv0/OrVq7njjjt4+umnkcTLL78MpJ79vHnz2HvvvTdt22OPPbj33nvp0aMHS5cuZeLEiTQ0NHDhhRdy6aWXcueddwLwwAMPbHr/Sy+9lJkzZzJq1CjWrl1Ljx49mDNnDr169WLhwoVAKhU1mjx5MldffTUDBgzgscceY8qUKdx3332cddZZnH766Zx00knMnDmzjY+alaCqnrukMZKWSFomaWozz0+StErSwvzvlNZvqtm2e+ihh/jkJz9Jz5492XnnnRk7duxmz++yyy706NGDk08+mdtvv52ePXsCMGrUKCZNmsS1117LW2+9BaRJWaeeeiqDBg3i+OOP58knn2zx+48aNYqzzz6bK6+8kpdffpmuXbfcn1q7di3z58/n+OOPZ8iQIZx22mm8+OKLAD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RqR36u3pK6kXvbpkrrl7fvn9e+bcy/wGUk9876NZZnewIv5PT5Vsf+a/JxZm3DP3erFINIFyI3AeuB0YANwZa6/dwUuBxZv4fW3ALfSTM85It7MNfurJL2DVG8/HLgO6Af8It/EZBVwTHNvHhH/KWkI0CDpTWAu8BXgn4HH8msf40+BPhu4VtLngeMi4tnqD4VZyzwU0sysQC7LmJkVyGUZs20gaRBwY5PNb0TEyFq0x2xLXJYxMyuQyzJmZgVyuJuZFcjhbmZWIIe7mVmB/j+CLKk+J1iKYQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# Calculate the percentage of employees who resigned due to dissatisfaction in each category\n", "dis_pct = combined_updated.pivot_table(index='service_cat', values='dissatisfied')\n", "\n", "# Plot the results\n", "%matplotlib inline\n", "dis_pct.plot(kind='bar', rot=30)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "From the initial analysis above, we can tentatively conclude that employees with 7 or more years of service are more likely to resign due to some kind of dissatisfaction with the job than employees with less than 7 years of service. However, we need to handle the rest of the missing data to finalize our analysis." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }