While i am saving Data Frames in Excel format ("*.xlsx"), i would like to add time stamp to Excel file name.
How can i add run time time stamp to Data Frame while saving in Excel format while saving file using Pandas? Thank you
You can use datetime module. It's one of the python standard library, you can access it by pd.datetime
like below.
import pandas as pd
writer = pd.ExcelWriter('output_{}.xlsx'.format(pd.datetime.today().strftime('%y%m%d-%H%M%S')))
df1.to_excel(writer,'Sheet1')
df2.to_excel(writer,'Sheet2')
writer.save()
And you can check format code table for the detail.