Skip to content

Instantly share code, notes, and snippets.

@mithunkamat
Created May 18, 2020 07:09
Show Gist options
  • Save mithunkamat/f56c009c0861d9f42a540582afa625f5 to your computer and use it in GitHub Desktop.
Save mithunkamat/f56c009c0861d9f42a540582afa625f5 to your computer and use it in GitHub Desktop.
Snippet demonstrating Pandas dataframe column renaming function.
mappings = {'loan identifier': 'loan_id',
'amt': 'amount',
...
'init fees': 'initial_fees'}
data.rename(mappings, axis=1, inplace=True)
# now, for the remainder of the code we use the data's Python given column names, 'loan_id', 'loan_amount', etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment