python - Renaming column names in Pandas - Stack Overflow

PHOTO EMBED

Sun Feb 27 2022 23:41:37 GMT+0000 (Coordinated Universal Time)

Saved by @Rajab #python

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

renaming a column in pandas

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