Hello everyone! I am currently working on project 3 “Exploring Ebay Car Sales Data”, in particular on step 2 “Cleaning column names”. I am using this kind of code to rename each column:
copy = copy.str.replace(‘monthOfRegistration’, ‘registration_month’)
copy = copy.str.replace(‘notRepairedDamage’, ‘unrepaired_damage’)
It is working, but I wanted to ask, is there any way to optimise this process and make it faster or in the real life we also have to rename each column on-by-one (the process seems a bit boring and time-consuming if there are a lot of columns)?
I came up only with this one to rename all the Type to _type:
copy = copy.str.replace(‘T’,’_t’)
Thank you in advance for your response.