Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove character(s)from each column in dataframe

for col in fromdatatable:
    fromdatatable[col] = fromdatatable[col].str.strip('þ') #remove þ from each column
    #fromdatatable[col] = fromdatatable[col].apply(lambda x: x.strip('þ')) #remove þ from each column
    #fromdatatable[col] = fromdatatable[col].apply(lambda x: x[1:-1]) #remove first and last characters from each column
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #column #dataframe
ADD COMMENT
Topic
Name
2+8 =