Created
June 1, 2020 15:33
-
-
Save kstreepy/17372d5c730fa672e3c2856a4fb7386d to your computer and use it in GitHub Desktop.
map in dict as new column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gs_group(df): | |
gs_dict = {'GS-1' : 'GS 1-6', | |
'GS-2' : 'GS 1-6', | |
'GS-3' : 'GS 1-6', | |
'GS-4' : 'GS 1-6', | |
'GS-5' : 'GS 1-6', | |
'GS-6' : 'GS 1-6', | |
'GS-7' : 'GS 7-9', | |
'GS-8' : 'GS 7-9', | |
'GS-9' : 'GS 7-9', | |
'GS-10' : 'GS 10-12', | |
'GS-11' : 'GS 10-12', | |
'GS-12' : 'GS 10-12', | |
'GS-13' : 'GS 13', | |
'GS-14' : 'GS 14', | |
'GS-15' : 'GS 15', | |
'Other' : 'Other', | |
'SES' : 'SES', | |
'SL' : 'SL & ST', | |
'ST' : 'SL & ST', | |
'NULL': None} | |
df['GS GROUP'] = df['GRADELEVEL'].map(gs_dict) | |
return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment