Created
January 6, 2020 22:52
-
-
Save fnneves/29ce01fa9241a9800dbdf4d7248ac9a9 to your computer and use it in GitHub Desktop.
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
def clean_header(df): | |
""" | |
This functions removes weird characters and spaces from column names, while keeping everything lower case | |
""" | |
df.columns = df.columns.str.strip().str.lower().str.replace(' ', '_').str.replace('(', '').str.replace(')', '') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment