I\'d like to save some text and a dataframe to an excel file like that:
Thus, I\'ve got the following variables:
text1 = \"some text here\"
text2 =
Above solution is correct... However
The write function is part of the xlsxwriter library. When declaring the writer you need to indicate what engine you want pandas to use.
writer = pd.ExcelWriter("test.xlsx", engine="xlsxwriter")
xlsxwriters functions are then usable through pandas. All other code in the above solution stays the same.
Ofcourse you require the library to be installed. Here is a programmatic check.
Would comment but rep to low