Screen Link: https://app.dataquest.io/m/348/guided-project%3A-clean-and-analyze-employee-exit-surveys/3/clean-column-names
Your Code:
'Gender. What is your Gender?':'gender', 'CurrentAge. Current Age': 'age',
'Employment Type. Employment Type':'employment_satus', 'Classification. Classification':'position',
'LengthofServiceOverall. Overall Length of Service at Institute (in years)': 'institute_service',
'LengthofServiceCurrent. Length of Service at current workplace (in years)': 'role_service'}
tafe_survey_updated = tafe_survey_updated.rename(tafe_column_mapping, axis=1)
# Check tafe column names
tafe_survey_updated.columns```
What I expected to happen:
Index(['id', 'Institute', 'WorkArea', 'cease_date', 'separationtype',
'Contributing Factors. Career Move - Public Sector ',
'Contributing Factors. Career Move - Private Sector ',
'Contributing Factors. Career Move - Self-employment',
'Contributing Factors. Ill Health',
'Contributing Factors. Maternity/Family',
'Contributing Factors. Dissatisfaction',
'Contributing Factors. Job Dissatisfaction',
'Contributing Factors. Interpersonal Conflict',
'Contributing Factors. Study', 'Contributing Factors. Travel',
'Contributing Factors. Other', 'Contributing Factors. NONE', 'gender',
'age', 'employment_status', 'position', 'institute_service',
'role_service'],
dtype='object')
What actually happened:
Index(['id', 'Institute', 'WorkArea', 'cease_date', 'separationtype',
'Contributing Factors. Career Move - Public Sector ',
'Contributing Factors. Career Move - Private Sector ',
'Contributing Factors. Career Move - Self-employment',
'Contributing Factors. Ill Health',
'Contributing Factors. Maternity/Family',
'Contributing Factors. Dissatisfaction',
'Contributing Factors. Job Dissatisfaction',
'Contributing Factors. Interpersonal Conflict',
'Contributing Factors. Study', 'Contributing Factors. Travel',
'Contributing Factors. Other', 'Contributing Factors. NONE',
'Gender. What is your Gender?', 'CurrentAge. Current Age',
'Employment Type. Employment Type',
'Classification. Classification', 'institute_service',
'role_service'],
dtype='object')
Other details: Only some of the column names correctly changed. For example 'Gender. What is your Gender?' did not change to 'gender'. I am not sure why.