Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas replace substring in column names

df.columns = df.columns.astype(str).str.replace("[()]", "_")
Source by app.dataquest.io #
 
PREVIOUS NEXT
Tagged: #pandas #replace #substring #column #names
ADD COMMENT
Topic
Name
9+1 =