Answers for "pandas replace space in column headers lowercase"

1

pandas convert all column names to lowercase

# rename Pandas columns to lower case
df.columns= df.columns.str.lower()
df.columns
Index(['column1', 'column2', 'column3'], dtype='object')
Posted by: Guest on November-13-2020
2

replace space with _ in pandas

data.columns = data.columns.str.replace(' ','_')
Posted by: Guest on August-13-2021

Code answers related to "pandas replace space in column headers lowercase"

Python Answers by Framework

Browse Popular Code Answers by Language