I export a dataframe to Excel this way:
import pandas as pd
df=pd.DataFrame( data= np.ones((4,2)), columns=['x','y'])
writer = pd.ExcelWriter('output.xlsx')
sheet='Test'
df.to_excel(writer,sheet)
writer.save()
How can I get python to write a few lines of description to the right of the dataframe? Something like: "this dataframe contains bla bla bla". Specifically:
- Can I use pandas to write to the same sheet? Or do I have to use
another module after
writer.save()? Saving and reopening seems like a waste of time and resources - If I cannot use pandas, what module shall I use? xlsxwriter cannot modify existing file.