Home > OS >  Excel formula formats from Python to Excel
Excel formula formats from Python to Excel

Time:11-30

I have a problem exporting Pandas data to excel: I want, for example to export a data like this

= 1 2 3

Now, to do this, I tried two ways:

d = p.DataFrame({'test1': ["=1 2 3"], 'test2': ["'=1 2 3"]})
d.to_excel('test3.xlsx')

Excel dispays the column this way:

test1 test2
6     '=1 2 3

Fo test2, I though excel would ignore the ', and consider the formula as a text, what I want. But it displays it. Do you know how could I do?

Thanks for help

CodePudding user response:

I suggest using Output: Formula string (text)

Check the usage of xlswriter with pandas here

  • Related