I have a pandas dataframe which I am trying to convert to string using newdf= old_df.to_string(index=False). After this step automatically spaces are being added to the first 2 row's. Any suggessions how to remove that?
old_df:
column_name
row1
row2
row3
newdf:
row1
row2
row3
If I do newdf=newdf.lstrip(' ') then the space at first row is removed but space at 2nd row remains as it is
newdf:
row1
row2
row3