Replace All Spacec Column With Underscore In Pandas Code Example

Snippet 1

  import pandas as pd 

# remove spaces in columns name
df.columns = df.columns.str.replace(' ','_') 

Copyright © Code Fetcher 2020

 

 

Leave a comment

Your email address will not be published. Required fields are marked *