In SAS, there is a compress function, which , when used without arguments on a string, will remove all white spaces, leading , trailing and in between. Is there a equivalent function in pandas? So:
have: ABC XYZ
want:ABCXYZ
In SAS, there is a compress function, which , when used without arguments on a string, will remove all white spaces, leading , trailing and in between. Is there a equivalent function in pandas? So:
have: ABC XYZ
want:ABCXYZ
Using replace
pd.Series(['ABC XYZ']).str.replace(' ','')
Out[695]:
0 ABCXYZ
dtype: object