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 = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
2>>> df.rename(columns={"A": "a", "B": "c"})
3 a c
40 1 4
51 2 5
62 3 6
7