New answers tagged

1

For anyone who's still facing the issue: None of the other suggestions worked for me or was too much work to do. I simply replaced all \n with \\n before saving to CSV and it'll preserve the newline character. df.Column_Name = df.Column_Name.apply(lambda x : x.replace('\n', '\\n')) df.to_csv("df.csv", index=False)


Top 50 recent answers are included