Renaming column names in Pandas

PHOTO EMBED

Wed Dec 14 2022 15:26:21 GMT+0000 (Coordinated Universal Time)

Saved by @lahiruaruna

df = df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'})
# Or rename the existing DataFrame (rather than creating a copy) 
df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'}, inplace=True)
content_copyCOPY

https://stackoverflow.com/questions/11346283/renaming-column-names-in-pandas