def report(simulation, filename='report.xls'):
""" This function generates a report as an excel sheet.
simulation the simualation that should be exported to excel
filename filename of the excel file
"""
writer = pd.ExcelWriter(filename)
for account in simulation.accounts:
df = account.report.as_df()
df.to_excel(writer, sheet_name=account.name)
writer.save()
评论列表
文章目录