python remove exta space in column

Solutions on MaxInterview for python remove exta space in column by the best coders in the world

showing results for - "python remove exta space in column"
Luciana
19 Nov 2017
1data = pd.DataFrame({'values': ['   ABC   ', '   DEF', '  GHI  ']})
2      values
30     ABC   
41        DEF
52      GHI  
6
7data['values'].str.strip()
80    ABC
91    DEF
102    GHI
Erwann
11 Jan 2018
1df.Name = df.Column_Name.replace('\s+', ' ', regex=True)