1
2import pandas as pd
3
4d1 = {'Name': ['Pankaj', 'Lisa', 'David'], 'ID': [1, 2, 3], 'Role': ['CEO', 'Editor', 'Author']}
5
6df = pd.DataFrame(d1)
7
8print('Source DataFrame:\n', df)
9
10df.rename(index={0: '#0', 1: '#1', 2: '#2'}, columns={'Name': 'EmpName', 'ID': 'EmpID', 'Role': 'EmpRole'}, inplace=True)
11
12print('Source DataFrame:\n', df)
13