I am receiving files and for some files columns are named differently. For example:
- In file 1, column names are: "studentID" , "ADDRESS", "Phone_number".
- In file 2, column names are: "Common_ID", "Common_Address", "Mobile_number".
- In file 3, column names are: "S_StudentID", "S_ADDRESS", "HOME_MOBILE".
I want to pass a dictionary after loading the file data into dataframes and in that dictionary I want to pass values like:
StudentId -> STUDENT_ID Common_ID -> STUDENT_ID S_StudentID -> STUDENT_ID ADDRESS -> S_ADDRESS Common_Address -> S_ADDRESS S_ADDRESS -> S_ADDRESS The reason for doing this because in my next dataframe I am reading column names like "STUDENT_ID", "S_ADDRESS" and if it will not find "S_ADDRESS", "STUDENT_ID" names in the dataframe, it will throw error for files whose names are not standardized. I want to run my dataframe and get values from those files after renaming in the above DF and one question when in run the new df will it pick the column name form dictionary having data in it.