'Writing a string to an Excel worksheet with Python and Pandas?
So I have the below and I want to store a dataframe and a string in separate worksheets. What function would I use for the string? to_excel only works with a dataframe so I'm stuck...
text = "abcdef"
df = {'col1': [1, 2], 'col2': [3, 4]}
with pd.ExcelWriter('file.xlsx') as write:
df.to_excelwriter(write, sheet_name = "sheet1")
text???? #Something to do with .write from xlswriter? Also want to name the worksheet with "sheet9" for example
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
