DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
pandas replace space with underscore in column names
df.rename(columns=lambda x: x.strip().replace(" ", "_"), inplace=True)
PREVIOUS
NEXT
Tagged:
#pandas
#replace
#space
#underscore
#column
#names
ADD COMMENT
Topic
COMMENT
Name
4+1 =
Submit