Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove extra blank spaces

df = pd.DataFrame({'Name':['Bertug     Mete','a','Joe    Black']})
print (df)
              Name
0  Bertug     Mete
1                a
2     Joe    Black

df.Name = df.Name.replace(r's+', ' ', regex=True)
#similar solution
#df.Name = df.Name.str.replace(r's+', ' ')
print (df)
          Name
0  Bertug Mete
1            a
2    Joe Black
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #extra #blank #spaces
ADD COMMENT
Topic
Name
5+7 =