Created
May 18, 2020 07:09
-
-
Save mithunkamat/f56c009c0861d9f42a540582afa625f5 to your computer and use it in GitHub Desktop.
Snippet demonstrating Pandas dataframe column renaming function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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