Rename columns in pandas
Published in
1 min readJan 17, 2020
df = df.rename(columns={“old_name”: “new_name”})
The general syntax to rename columns in pandas is:
Here is an example
Tired of googling pandas commands?
Rename a column within seconds and get the pandas code, so that you don’t need to think about the pandas syntax anymore. With bamboolib, you can focus on what you want to do instead of how you do it.