Skip to content

Instantly share code, notes, and snippets.

@paulphys
Last active November 5, 2019 20:30
Show Gist options
  • Save paulphys/65ed7e012bce25531186b4bf60fc63d0 to your computer and use it in GitHub Desktop.
Save paulphys/65ed7e012bce25531186b4bf60fc63d0 to your computer and use it in GitHub Desktop.
removing spaces from dataframe columns
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