Skip to content

Instantly share code, notes, and snippets.

@reservoirinvest
Last active November 9, 2017 05:13
Show Gist options
  • Save reservoirinvest/7db87eab91c9148e646112b46144f7b2 to your computer and use it in GitHub Desktop.
Save reservoirinvest/7db87eab91c9148e646112b46144f7b2 to your computer and use it in GitHub Desktop.
Rename column names #pandas
df = df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'})
# OR
df.rename(columns={'oldName1': 'newName1', 'oldName2': 'newName2'}, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment