Created
August 8, 2013 12:57
-
-
Save chhantyal/6184344 to your computer and use it in GitHub Desktop.
This file contains 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 change_keys(row_dict): | |
""" | |
It returns a dictionary with keys in English and all lowercase. | |
Create a dictionary to map keys to given dictionary keys. | |
Following is Dutch to English text mapping. | |
""" | |
dict_map = { | |
'Leerlingnummer': 'student_id', | |
'Voornamen': 'first_name', | |
'Achternaam': 'last_name', | |
'Groepsnaam huidige groepsindeling': 'class_id', | |
'Email adres ouder woonadres': 'parents_email', | |
'address': 'address', | |
'Telefoonnummer': 'phone', | |
'Mobielnummer ouder woonadres' : 'mobile' | |
} | |
final_row = {dict_map[k]: v for k, v in row_dict.items()} | |
return final_row |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment