I have a dataframe where one of the columns contains strings. But they have some tab formatting for each of them. Below is a snippet of how it looks like
formatted_line_items[1:3]
Out[393]: ['\t<string1>', '\t\t<string2>']
However when I write the dataframe using to_csv the formatting is lost. How can I write this to a csv file or excel file and still retain the formatting?
EDIT: I got to know that csv doesn't retain formatting so I used the pandas to_excel function but still no luck with the formatting.