1df.rename(columns={'oldName1': 'newName1',
2 'oldName2': 'newName2'},
3 inplace=True, errors='raise')
4# Make sure you set inplace to True if you want the change
5# to be applied to the dataframe
1#df.rename() will only return a new df with the new headers
2#df = df.rename() will change the heders of the current dataframe
3df = df.rename(columns={"old_col1": "new_col1", "old_col2": "new_col2"})