rename one col pandas code example
Example 1: pd dataframe single column rename
df1 = df.rename(columns={'Name': 'EmpName'})
print(df1)
Example 2: pandas rename single column
data.rename(columns={'oldName':'newName'}, inplace=True)
df1 = df.rename(columns={'Name': 'EmpName'})
print(df1)
data.rename(columns={'oldName':'newName'}, inplace=True)